File tree Expand file tree Collapse file tree
StyleCop.Analyzers/StyleCop.Analyzers.Test/SpacingRules Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1727,6 +1727,41 @@ public void TestMethod()
17271727 await this . VerifyCSharpFixAsync ( testCode , fixedTestCode ) . ConfigureAwait ( false ) ;
17281728 }
17291729
1730+ /// <summary>
1731+ /// This is a regression test for DotNetAnalyzers/StyleCopAnalyzers#1585:
1732+ /// https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/1585
1733+ /// </summary>
1734+ /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
1735+ [ Fact ]
1736+ public async Task TestCrefAttributeAsync ( )
1737+ {
1738+ var testCode = @"
1739+ public class TestClass
1740+ {
1741+ /// <see cref=""Method ()""/>
1742+ public void Method()
1743+ {
1744+ }
1745+ }
1746+ " ;
1747+
1748+ var fixedCode = @"
1749+ public class TestClass
1750+ {
1751+ /// <see cref=""Method()""/>
1752+ public void Method()
1753+ {
1754+ }
1755+ }
1756+ " ;
1757+
1758+ var expected = this . CSharpDiagnostic ( ) . WithLocation ( 4 , 27 ) . WithArguments ( " not" , "preceded" ) ;
1759+
1760+ await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
1761+ await this . VerifyCSharpDiagnosticAsync ( fixedCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
1762+ await this . VerifyCSharpFixAsync ( testCode , fixedCode ) . ConfigureAwait ( false ) ;
1763+ }
1764+
17301765 /// <inheritdoc/>
17311766 protected override IEnumerable < DiagnosticAnalyzer > GetCSharpDiagnosticAnalyzers ( )
17321767 {
You can’t perform that action at this time.
0 commit comments