From 40df197d83611720654dd9dd607141a0796481ef Mon Sep 17 00:00:00 2001 From: Dennis Fischer Date: Fri, 21 Aug 2015 16:12:56 +0200 Subject: [PATCH] Implement regression test for #1254 --- .../ReadabilityRules/SA1106UnitTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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();