Skip to content

Commit 63772da

Browse files
committed
Update SA1611 for partial methods
1 parent a8920aa commit 63772da

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp9/DocumentationRules/SA1611CSharp9UnitTests.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,33 @@ namespace StyleCop.Analyzers.Test.CSharp9.DocumentationRules
99
using StyleCop.Analyzers.Test.CSharp8.DocumentationRules;
1010
using StyleCop.Analyzers.Test.Helpers;
1111
using Xunit;
12+
using static StyleCop.Analyzers.Test.Verifiers.CustomDiagnosticVerifier<StyleCop.Analyzers.DocumentationRules.SA1611ElementParametersMustBeDocumented>;
1213

1314
public partial class SA1611CSharp9UnitTests : SA1611CSharp8UnitTests
1415
{
16+
[Fact]
17+
[WorkItem(3971, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3971")]
18+
public async Task TestPartialMethodDeclarationMissingParameterDocumentationAsync()
19+
{
20+
var testCode = @"
21+
/// <summary>
22+
/// Tests a partial method.
23+
/// </summary>
24+
public partial class TestClass
25+
{
26+
/// <summary>Declaration.</summary>
27+
public partial void TestMethod(int {|#0:value|});
28+
29+
public partial void TestMethod(int value)
30+
{
31+
}
32+
}";
33+
34+
var expected = Diagnostic().WithLocation(0).WithArguments("value");
35+
36+
await VerifyCSharpDiagnosticAsync(testCode, new[] { expected }, CancellationToken.None).ConfigureAwait(false);
37+
}
38+
1539
[Theory]
1640
[MemberData(nameof(CommonMemberData.RecordTypeDeclarationKeywords), MemberType = typeof(CommonMemberData))]
1741
[WorkItem(3770, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3770")]

0 commit comments

Comments
 (0)