Skip to content

Commit

Permalink
Implement regression test for DotNetAnalyzers#1254
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelvo committed Aug 21, 2015
1 parent c2b0332 commit 40df197
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<DiagnosticAnalyzer> GetCSharpDiagnosticAnalyzers()
{
yield return new SA1106CodeMustNotContainEmptyStatements();
Expand Down

0 comments on commit 40df197

Please sign in to comment.