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 1a40d62
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 documentation comments.
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
[Fact]
public async Task TestCommentFollowedBySingleLineDocumenationCommentAsync()
{
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 documentation comments.
/// </summary>
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
[Fact]
public async Task TestCommentFollowedByMultiLineDocumentationCommentAsync()
{
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 1a40d62

Please sign in to comment.