-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Also support codefix for .Within #670
Also support codefix for .Within #670
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Laniusexcubitor Thanks for your contribution.
I have made some tiny changes.
One to ensure that the test validates that the correct parameter is swapped.
The other because I'm pedantic and don't like abbreviated variable names.
public void Test() | ||
{{ | ||
int expected = 5; | ||
ClassicAssert.{classicAssertMethod}(expected, ↓1, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is never good to use two arguments with the same value as it doesn't proof that the correct argument is exchanged.
I have update the code to use double.Epsilon
for the accuracy.
if (invocationExpression.Expression is not MemberAccessExpressionSyntax mae) | ||
{ | ||
memberAccessExpression = null; | ||
return false; | ||
} | ||
|
||
memberAccessExpression = mae; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I simplified this a tiny bit. Mainly because I don't like shorthand names like mae
if (memberAccessExpression.Name.ToString() == NUnitFrameworkConstants.NameOfEqualConstraintWithin) | ||
{ | ||
// e.g. Is.EqualTo(1).Within(1) or Is.Not.EqualTo(1).Within(1) | ||
if (memberAccessExpression.Expression is not InvocationExpressionSyntax ies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed ies
into innerInnovationExpression
fixes #669