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

Extent rule NUnit2010 to detect 'is null' #691

Closed
manfred-brands opened this issue Feb 16, 2024 · 1 comment · Fixed by #703
Closed

Extent rule NUnit2010 to detect 'is null' #691

manfred-brands opened this issue Feb 16, 2024 · 1 comment · Fixed by #703
Assignees
Milestone

Comments

@manfred-brands
Copy link
Member

Rule NUnit2010 fires for: Assert.That(instance == null) but not for Assert.That(instance is null).
It should also detected is not null to mean != null.
Code fixes should create: Assert.That(instance, Is.Null) and Assert.That(instance, Is.Not.Null) respectively.

@manfred-brands
Copy link
Member Author

PR can also deal with more complex is pattern expressions like:
is < 0 or >= 1
which gets translated into
Is.LessThan(0).Or.GreaterThanOrEqualTo(1)

@mikkelbu mikkelbu added this to the Release 4.1 milestone Mar 16, 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
2 participants