-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove trailing white-space in documentation comment (RCS1037)
- Loading branch information
1 parent
4c4281e
commit c3f7d19
Showing
3 changed files
with
77 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/Tests/Analyzers.Tests/RCS1037RemoveTrailingWhitespaceTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright (c) Josef Pihrt. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Threading.Tasks; | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.CodeFixes; | ||
using Microsoft.CodeAnalysis.Diagnostics; | ||
using Roslynator.CSharp.CodeFixes; | ||
using Xunit; | ||
|
||
namespace Roslynator.CSharp.Analysis.Tests | ||
{ | ||
public class RCS1037RemoveTrailingWhitespaceTests : AbstractCSharpFixVerifier | ||
{ | ||
public override DiagnosticDescriptor Descriptor { get; } = DiagnosticDescriptors.RemoveTrailingWhitespace; | ||
|
||
public override DiagnosticAnalyzer Analyzer { get; } = new WhitespaceAnalyzer(); | ||
|
||
public override CodeFixProvider FixProvider { get; } = new WhitespaceTriviaCodeFixProvider(); | ||
|
||
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveTrailingWhitespace)] | ||
public async Task Test() | ||
{ | ||
await VerifyDiagnosticAndFixAsync(@"[| |] | ||
class C[| |] | ||
{ | ||
[| | ||
|] | ||
} | ||
", @" | ||
class C | ||
{ | ||
} | ||
"); | ||
} | ||
|
||
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.RemoveTrailingWhitespace)] | ||
public async Task Test_DocumentationComment() | ||
{ | ||
await VerifyDiagnosticAndFixAsync(@" | ||
class C | ||
{ | ||
/// <summary>[| |] | ||
/// x[| |] | ||
/// </summary>[| |] | ||
void M() | ||
{ | ||
} | ||
} | ||
", @" | ||
class C | ||
{ | ||
/// <summary> | ||
/// x | ||
/// </summary> | ||
void M() | ||
{ | ||
} | ||
} | ||
"); | ||
} | ||
} | ||
} |