I opted for the same set of overloads as for RoslynAssert.Diagnostics, but are open for change there.
Priniciple is:
Check the code for '↓' or use ExpectedDiagnostics
Compile code without DiagnoticSuppressor to ensure that ExpectedDiagnostic is raised.
Compile code with the DiagnosticSuppressor and check if the diagnostic IsSuppressed.
I tried it out with one of my analyzers and it seems to work fine.
Once this is in and release, I will update nunit.analyzers to use it as well, dropping the code there.
Initially I went for different approach, but the 2nd version aligns much better with the existing framework.
I have not looked at the analyzer to see what needs changing there so that it warns of missing '↓'. It doesn't do so at the moment.
Fixes #253
Not related and we can split this into two PRs is you prefer.
Fixes #165
I opted for the same set of overloads as for
RoslynAssert.Diagnostics
, but are open for change there.Priniciple is:
ExpectedDiagnostics
DiagnoticSuppressor
to ensure thatExpectedDiagnostic
is raised.DiagnosticSuppressor
and check if the diagnosticIsSuppressed
.I tried it out with one of my analyzers and it seems to work fine. Once this is in and release, I will update nunit.analyzers to use it as well, dropping the code there.
Initially I went for different approach, but the 2nd version aligns much better with the existing framework. I have not looked at the analyzer to see what needs changing there so that it warns of missing '↓'. It doesn't do so at the moment.
Fixes #253
Not related and we can split this into two PRs is you prefer.