We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
NUnit2045
I have a test like this
[Test] public void MyTest() { object? actualDeserialized = null; Assert.That(() => actualDeserialized = Calculate(), Throws.Nothing); Assert.That(actualDeserialized, Is.Not.Null); } private static object? Calculate() { return new(); }
This triggers NUnit2045. However, because the lambda captures the actualDeserialized variable, these two assertions are not independent.
actualDeserialized
Is there any way Roslyn can delect when a lambda captures a certain variable, so NUnit2045 can be disabled for this circumstance?
edit: my minimal repro did demonstrate the issue, but was a little nonsensical. I tweaked it.
The text was updated successfully, but these errors were encountered:
manfred-brands
Successfully merging a pull request may close this issue.
I have a test like this
This triggers
NUnit2045
. However, because the lambda captures theactualDeserialized
variable, these two assertions are not independent.Is there any way Roslyn can delect when a lambda captures a certain variable, so
NUnit2045
can be disabled for this circumstance?edit: my minimal repro did demonstrate the issue, but was a little nonsensical. I tweaked it.
The text was updated successfully, but these errors were encountered: