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

Warns about passing a non-lambda to Throws assertions. #357

Closed
manfred-brands opened this issue Feb 11, 2021 · 2 comments · Fixed by #359
Closed

Warns about passing a non-lambda to Throws assertions. #357

manfred-brands opened this issue Feb 11, 2021 · 2 comments · Fixed by #359
Assignees

Comments

@manfred-brands
Copy link
Member

manfred-brands commented Feb 11, 2021

People sometimes write Assert.That(MyMethod(), Throws.InstanceOf<SomeException>()); and wonder why it fails.

We need an analyzer rule that detects this and with code-fixes that convert the code to:
Assert.That(() => MyMethod(), Throws.InstanceOf<SomeException>());

@manfred-brands
Copy link
Member Author

@mikkelbu You can assign this to me.

@mikkelbu
Copy link
Member

Thanks @manfred-brands

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

Successfully merging a pull request may close this issue.

2 participants