Skip to content
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

Missing negation when transforming OnlyContain #2

Open
jnyrup opened this issue Oct 13, 2017 · 1 comment
Open

Missing negation when transforming OnlyContain #2

jnyrup opened this issue Oct 13, 2017 · 1 comment
Labels

Comments

@jnyrup
Copy link
Member

jnyrup commented Oct 13, 2017

When applying the codefix for CollectionShouldNotContainProperty, the comparison inside the lambda should also be negated.

actual.Should().OnlyContain(x => x.OtherProperty == expectedValue); // before
actual.Should().NotContain(x => x.OtherProperty == expectedValue);  // after
@jnyrup
Copy link
Member Author

jnyrup commented Oct 14, 2017

Here's how others are negating expressions:
https://github.com/JosefPihrt/Roslynator/blob/9098bd81a98e5b57ce65546628cb8d8349ca888f/source/Core/CSharp/Helpers/LogicalNegationHelper.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants