@@ -47,6 +47,27 @@ public class TestClass
4747 await this . VerifyCSharpDiagnosticAsync ( testCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
4848 }
4949
50+ [ Theory ]
51+ [ MemberData ( nameof ( Members ) ) ]
52+ public async Task VerifyThatCorrectDocumentationWithEmptyElementsDoesNotReportADiagnosticAsync ( string member )
53+ {
54+ var testCode = $@ "
55+ public class TestClass
56+ {{
57+ /// <summary>
58+ /// Some documentation <see cref=""TestClass""/>.
59+ /// </summary>
60+ /// <summary>
61+ /// Some documentation <see cref=""TestClass2""/>.
62+ /// </summary>
63+ /// <remark>Some remark.</remark>
64+ { member }
65+ }}
66+ public class TestClass2 {{ }}
67+ " ;
68+ await this . VerifyCSharpDiagnosticAsync ( testCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
69+ }
70+
5071 [ Theory ]
5172 [ MemberData ( nameof ( Members ) ) ]
5273 public async Task VerifyThatTheAnalyzerDoesNotCrashOnInheritDocAsync ( string member )
@@ -61,6 +82,27 @@ public class TestClass
6182 await this . VerifyCSharpDiagnosticAsync ( testCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
6283 }
6384
85+ [ Theory ]
86+ [ MemberData ( nameof ( Members ) ) ]
87+ public async Task VerifyThatWhitespacesAreNormalizedForEmptyXmlElementsAsync ( string member )
88+ {
89+ var testCode = $@ "
90+ public class TestClass
91+ {{
92+ /// <summary>
93+ /// Some documentation <see cref=""TestClass""/>.
94+ /// </summary>
95+ /// <summary>
96+ /// Some documentation <see cref = ""TestClass"" />.
97+ /// </summary>
98+ /// <remark>Some remark.</remark>
99+ { member }
100+ }}
101+ " ;
102+ var expected = this . CSharpDiagnostic ( ) . WithLocation ( 7 , 9 ) ;
103+ await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
104+ }
105+
64106 [ Theory ]
65107 [ MemberData ( nameof ( Members ) ) ]
66108 public async Task VerifyThatDublicatedDocumentationDoesReportADiagnosticAsync ( string member )
0 commit comments