diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test/ReadabilityRules/SA1106UnitTests.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test/ReadabilityRules/SA1106UnitTests.cs index 87901420f..8ea38de69 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test/ReadabilityRules/SA1106UnitTests.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test/ReadabilityRules/SA1106UnitTests.cs @@ -116,6 +116,21 @@ public void TestMethod() await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false); } + [Theory] + [InlineData("class Foo { }")] + [InlineData("struct Foo { }")] + [InlineData("interface IFoo { }")] + [InlineData("enum Foo { }")] + public async Task TestTypeAsync(string declaration) + { + var testCode = declaration + @" +;"; + + DiagnosticResult expected = this.CSharpDiagnostic().WithLocation(2, 1); + + await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false); + } + protected override IEnumerable GetCSharpDiagnosticAnalyzers() { yield return new SA1106CodeMustNotContainEmptyStatements();