Skip to content

Commit eb324ac

Browse files
Improve coverage for SA1404 by adding test for other attributes besides suppressions
1 parent db6febe commit eb324ac

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/SA1404UnitTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,5 +410,19 @@ public void Bar()
410410
};
411411
await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
412412
}
413+
414+
[Fact]
415+
public async Task TestOtherAttributeAsync()
416+
{
417+
var testCode = @"public class Foo
418+
{
419+
[System.Obsolete(""Method is obsolete!"")]
420+
public void Bar()
421+
{
422+
}
423+
}";
424+
425+
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
426+
}
413427
}
414428
}

0 commit comments

Comments
 (0)