Skip to content

Commit

Permalink
Add regression tests for DotNetAnalyzers#1130
Browse files Browse the repository at this point in the history
  • Loading branch information
Noryoko committed Aug 7, 2015
1 parent cedc7e8 commit 0f6b8ec
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,50 @@ namespace Foo
await this.VerifyCSharpFixAsync(testCode, fixedTestCode).ConfigureAwait(false);
}

/// <summary>
/// Verifies that the analyzer will properly handle comments followed by single line XML comments.
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
[Fact]
public async Task TestCommentFollowedBySingleLineXmlCommentAsync()
{
var testCode = @"// some comment
/// <summary>Test summary.</summary>
public class TestClass
{
// another comment
/// <summary>Test summary.</summary>
public void TestMethod() { }
}
";

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

/// <summary>
/// Verifies that the analyzer will properly handle comments followed by multi-line XML comments.
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
[Fact]
public async Task TestCommentFollowedByMultiLineXmlCommentAsync()
{
var testCode = @"// some comment
/* <summary>Test summary.</summary> */
public class TestClass
{
// another comment
/* <summary>Test summary.</summary> */
public void TestMethod() { }
}
";

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

/// <inheritdoc/>
protected override IEnumerable<DiagnosticAnalyzer> GetCSharpDiagnosticAnalyzers()
{
Expand Down

0 comments on commit 0f6b8ec

Please sign in to comment.