-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add quickfix that swaps actual and expected value #1
Comments
Good catch! What is the original assert code? Also, is the code using NUnit or xUnit? |
This code from my very old project, tests writen used NUnit. Assert.AreEqual(result, "video1234_1234_test");
^^^^^^^, ^^^^^^^^
expected, actual but i think this problem can reproduce and for xUnit |
It seems you swapped the The analyzer uses the following semantic:
|
I did this deliberately to show what the problem was, but in those distant times it was not at all obvious to me. |
I see an order like this:
Assert.AreEqual(result, "video1234_1234_test");
"video1234_1234_test".Should().Be(result);
"video1234_1234_test".Should().Be(result);
result.Should().Be("video1234_1234_test"); |
I thought you were reporting a bug, but it's a feature request! Something we can try is detecting constant values on the left side and report them because I don't think there is a valid reason to have a constant before "Should". |
yes you are right this new functionality, perhaps I did not exactly express myself when describing |
For example:
should be replaced with:
The text was updated successfully, but these errors were encountered: