Skip to content

Fix NullConditionalAssertion false positive #170

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

Merged
merged 9 commits into from
May 23, 2023
Merged

Fix NullConditionalAssertion false positive #170

merged 9 commits into from
May 23, 2023

Conversation

renzo-baasdam
Copy link
Contributor

As noted in #91, the NullConditionalAssertion analyzer gives a false positive for statements like:
(actual?.MyProperty).Should().Be(expected);
This PR should fix the above case along with statements where a null-conditional is used in an argument list, for example:
actual.MyList.Where(obj => obj?.ToString() == null).Count().Should().Be(expected);

@rcdailey
Copy link

Is there a reason this hasn't been merged yet? Is there anything I can help with?

@Meir017 Meir017 merged commit 06b2dea into fluentassertions:master May 23, 2023
@Meir017
Copy link
Member

Meir017 commented May 24, 2023

@renzo-baasdam @rcdailey version 0.17.3 is out now

@renzo-baasdam renzo-baasdam deleted the fix-null-conditional-assertion branch May 24, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants