File tree Expand file tree Collapse file tree
StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,17 +16,19 @@ namespace StyleCop.Analyzers.Test.MaintainabilityRules
1616
1717 public class SA1404UnitTests
1818 {
19- [ Fact ]
20- public async Task TestSuppressionWithStringLiteralAsync ( )
19+ [ Theory ]
20+ [ InlineData ( "SuppressMessage" ) ]
21+ [ InlineData ( "SuppressMessageAttribute" ) ]
22+ public async Task TestSuppressionWithStringLiteralAsync ( string attributeName )
2123 {
22- var testCode = @"public class Foo
23- {
24- [System.Diagnostics.CodeAnalysis.SuppressMessage (null, null, Justification = ""a justification"")]
24+ var testCode = $ @ "public class Foo
25+ {{
26+ [System.Diagnostics.CodeAnalysis.{ attributeName } (null, null, Justification = ""a justification"")]
2527 public void Bar()
26- {
28+ {{
2729
28- }
29- }" ;
30+ }}
31+ }} " ;
3032
3133 await VerifyCSharpDiagnosticAsync ( testCode , DiagnosticResult . EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
3234 }
You can’t perform that action at this time.
0 commit comments