Skip to content

Commit 96ae590

Browse files
authored
Merge pull request #2425 from sharwell/verifier-tests
Add tests for DiagnosticVerifier
2 parents 60bc0ed + a0ae67c commit 96ae590

3 files changed

Lines changed: 479 additions & 0 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/Helpers/DiagnosticResult.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ public bool HasLocation
9393
}
9494
}
9595

96+
public DiagnosticResult WithSeverity(DiagnosticSeverity severity)
97+
{
98+
DiagnosticResult result = this;
99+
result.Severity = severity;
100+
return result;
101+
}
102+
96103
public DiagnosticResult WithArguments(params object[] arguments)
97104
{
98105
DiagnosticResult result = this;

StyleCop.Analyzers/StyleCop.Analyzers.Test/StyleCop.Analyzers.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@
421421
<Compile Include="SpecialRules\SA0002UnitTests.cs" />
422422
<Compile Include="Verifiers\CodeFixVerifier.cs" />
423423
<Compile Include="Verifiers\DiagnosticVerifier.cs" />
424+
<Compile Include="Verifiers\DiagnosticVerifierTests.cs" />
424425
</ItemGroup>
425426
<ItemGroup>
426427
<None Include="..\..\build\keys\TestingKey.snk">

0 commit comments

Comments
 (0)