@@ -78,7 +78,7 @@ public class TestClass
7878 }
7979
8080 /// <summary>
81- /// Verifies that documentation that starts with the proper text for multiple accessors will not produce this
81+ /// Verifies that documentation that starts with the proper text for a lone getter will not produce this
8282 /// diagnostic when the property has an expression body.
8383 /// </summary>
8484 /// <param name="accessibility">The accessibility of the property.</param>
@@ -107,52 +107,6 @@ public class TestClass
107107 await this . VerifyCSharpDiagnosticAsync ( testCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
108108 }
109109
110- /// <summary>
111- /// Verifies that documentation that starts with the proper text for multiple accessors will produce a diagnostic for expression body properties.
112- /// </summary>
113- /// <param name="accessibility">The accessibility of the property.</param>
114- /// <param name="type">The type to use for the property.</param>
115- /// <param name="summaryPrefix">The prefix to use in the summary text.</param>
116- /// <param name="expectedArgument1">The first expected argument for the diagnostic.</param>
117- /// <param name="expectedArgument2">The second expected argument for the diagnostic.</param>
118- /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
119- [ Theory ( DisplayName = "ExpressionBody Gets&Sets" ) ]
120- [ InlineData ( "public" , "int" , "Gets or sets" , "get" , "Gets" ) ]
121- [ InlineData ( "public" , "bool" , "Gets or sets a value indicating whether" , "get" , "Gets a value indicating whether" ) ]
122- [ InlineData ( "protected" , "int" , "Gets or sets" , "get" , "Gets" ) ]
123- [ InlineData ( "protected internal" , "int" , "Gets or sets" , "get" , "Gets" ) ]
124- [ InlineData ( "internal" , "int" , "Gets or sets" , "get" , "Gets" ) ]
125- public async Task VerifyThatInvalidDocumentationWillReportDiagnosticForExpressionBodyAsync ( string accessibility , string type , string summaryPrefix , string expectedArgument1 , string expectedArgument2 )
126- {
127- var testCode = $@ "
128- public class TestClass
129- {{
130- /// <summary>
131- /// { summaryPrefix } the test property.
132- /// </summary>
133- { accessibility } { type } TestProperty =>
134- default({ type } );
135- }}
136- " ;
137-
138- var fixedTestCode = $@ "
139- public class TestClass
140- {{
141- /// <summary>
142- /// { expectedArgument2 } the test property.
143- /// </summary>
144- { accessibility } { type } TestProperty =>
145- default({ type } );
146- }}
147- " ;
148-
149- var expected = this . CSharpDiagnostic ( PropertySummaryDocumentationAnalyzer . SA1624Descriptor ) . WithLocation ( 7 , 7 + accessibility . Length + type . Length ) . WithArguments ( expectedArgument1 , expectedArgument2 ) ;
150-
151- await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
152- await this . VerifyCSharpDiagnosticAsync ( fixedTestCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
153- await this . VerifyCSharpFixAsync ( testCode , fixedTestCode ) . ConfigureAwait ( false ) ;
154- }
155-
156110 /// <summary>
157111 /// Verify that no diagnostic will be reported when a public and a private accessor are present within a property that is defined in a contained class of a private class.
158112 /// </summary>
0 commit comments