File tree Expand file tree Collapse file tree
StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,6 +152,39 @@ private class PrivateTestClass
152152 await this . VerifyCSharpFixAsync ( testCode , fixedTestCode ) . ConfigureAwait ( false ) ;
153153 }
154154
155+ /// <summary>
156+ /// Verifies that empty summary tag does not throw an exception.
157+ /// Regression test for #1943
158+ /// </summary>
159+ /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
160+ [ Fact ]
161+ public async Task EmptySummaryTagShouldNotThrowAnExceptionAsync ( )
162+ {
163+ var testCode = @"public class ClassName
164+ {
165+ /// <summary></summary>
166+ public int Property
167+ {
168+ get;
169+ }
170+ }" ;
171+
172+ var fixedTestCode = @"public class ClassName
173+ {
174+ /// <summary>Gets Property</summary>
175+ public int Property
176+ {
177+ get;
178+ }
179+ }" ;
180+
181+ var expected = this . CSharpDiagnostic ( PropertySummaryDocumentationAnalyzer . SA1623Descriptor ) . WithLocation ( 4 , 16 ) . WithArguments ( "Gets" ) ;
182+
183+ await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
184+ await this . VerifyCSharpDiagnosticAsync ( fixedTestCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
185+ await this . VerifyCSharpFixAsync ( testCode , fixedTestCode ) . ConfigureAwait ( false ) ;
186+ }
187+
155188 /// <inheritdoc/>
156189 protected override CodeFixProvider GetCSharpCodeFixProvider ( )
157190 {
You can’t perform that action at this time.
0 commit comments