Skip to content

Commit

Permalink
add regression test for DotNetAnalyzers#830
Browse files Browse the repository at this point in the history
  • Loading branch information
Noryoko committed Aug 8, 2015
1 parent e5ca4db commit 343cf84
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,35 @@ public static void Bar()
await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
}

[Fact]
public async Task TestPragmaDirectivesAsync()
{
var testCode = @"using System;
public class SomeOtherClass
{
private void SomeMethod()
{
this.SomeOtherMethod(
#pragma warning disable 618
this.SomeObsoleteMethod());
#pragma warning restore 618
}
[Obsolete(""Don't use me!"")]
private int SomeObsoleteMethod()
{
return 0;
}
private void SomeOtherMethod(int someParameter)
{
}
}";

await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
}

protected override IEnumerable<DiagnosticAnalyzer> GetCSharpDiagnosticAnalyzers()
{
yield return new SA1114ParameterListMustFollowDeclaration();
Expand Down

0 comments on commit 343cf84

Please sign in to comment.