Skip to content

Commit 301c554

Browse files
committed
Merge pull request #1471 from sharwell/fix-631
Add additional tests for SA1613 with <inheritdoc/>
2 parents 55cdd42 + 39ec93f commit 301c554

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1613UnitTests.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,35 @@ public class ClassName
108108
await this.VerifyCSharpDiagnosticAsync(testCode.Replace("$$", declaration), expected, CancellationToken.None).ConfigureAwait(false);
109109
}
110110

111+
[Theory]
112+
[MemberData(nameof(Declarations))]
113+
public async Task TestMemberWithInvalidParamsAndInheritDocAsync(string declaration)
114+
{
115+
var testCode = @"
116+
/// <summary>
117+
/// Foo
118+
/// </summary>
119+
public class ClassName
120+
{
121+
/// <inheritdoc/>
122+
///<param>Test</param>
123+
///<param/>
124+
///<param name="""">Test</param>
125+
///<param name="" "">Test</param>
126+
$$
127+
}";
128+
129+
var expected = new[]
130+
{
131+
this.CSharpDiagnostic().WithLocation(8, 8),
132+
this.CSharpDiagnostic().WithLocation(9, 8),
133+
this.CSharpDiagnostic().WithLocation(10, 15),
134+
this.CSharpDiagnostic().WithLocation(11, 15)
135+
};
136+
137+
await this.VerifyCSharpDiagnosticAsync(testCode.Replace("$$", declaration), expected, CancellationToken.None).ConfigureAwait(false);
138+
}
139+
111140
protected override IEnumerable<DiagnosticAnalyzer> GetCSharpDiagnosticAnalyzers()
112141
{
113142
yield return new SA1613ElementParameterDocumentationMustDeclareParameterName();

0 commit comments

Comments
 (0)