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

[suggestion] New diagnostic: Use NullConstraint and EmptyConstraint for better assertion messages in case of failure #753

Open
Bartleby2718 opened this issue Jun 2, 2024 · 1 comment

Comments

@Bartleby2718
Copy link
Contributor

Continuing to file small tickets so that each ticket can be picked up by different people in parallel, if need be.

Both Assert.That(string.IsNullOrEmpty(myString)); and Assert.That(myString.IsNullOrEmpty()); could be converted to
Assert.That(myString, Is.Null.Or.Empty);.

Not sure what a good title for this diagnostic would be, though.

@mikkelbu
Copy link
Member

mikkelbu commented Jun 5, 2024

I agree that we could add an analyzer with codefix for this

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

No branches or pull requests

2 participants