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

Possibly Null Reference Warning should be suppressed for Assume #693

Closed
TheBigNeo opened this issue Feb 19, 2024 · 0 comments · Fixed by #702
Closed

Possibly Null Reference Warning should be suppressed for Assume #693

TheBigNeo opened this issue Feb 19, 2024 · 0 comments · Fixed by #702
Assignees
Milestone

Comments

@TheBigNeo
Copy link

The DereferencePossiblyNullReferenceSuppressor class suppresses the Possible 'System.NullReferenceException' warning in case of:

Assert.That(exception,           Is.Not.Null);
Assert.That(exception.ParamName, Is.EqualTo("udpClient")); //<< No warning

Would it be possible for this to work for Assume as well?

Assume.That(exception, Is.Not.Null)
string name = exception.ParamName; //<< Possible 'System.NullReferenceException' warning
@manfred-brands manfred-brands changed the title Possibly Null Reference Waning should be suppressed for Assume Possibly Null Reference Warning should be suppressed for Assume Feb 19, 2024
@manfred-brands manfred-brands self-assigned this Feb 19, 2024
@mikkelbu mikkelbu added this to the Release 4.1 milestone Mar 11, 2024
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 a pull request may close this issue.

3 participants