Skip to content

Commit 88cf7a1

Browse files
Improve coverage for SA1600 by adding tests for partial types
1 parent 487935c commit 88cf7a1

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1600UnitTests.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,28 @@ public async Task TestClassWithoutDocumentationAsync()
4646
await this.TestTypeWithoutDocumentationAsync("class", false).ConfigureAwait(false);
4747
}
4848

49+
[Fact]
50+
public async Task TestPartialClassWithoutDocumentationAsync()
51+
{
52+
await this.TestTypeDeclarationDocumentationAsync("class", "partial", false, false).ConfigureAwait(false);
53+
await this.TestTypeDeclarationDocumentationAsync("class", "internal partial", false, false).ConfigureAwait(false);
54+
await this.TestTypeDeclarationDocumentationAsync("class", "public partial", false, false).ConfigureAwait(false);
55+
}
56+
4957
[Fact]
5058
public async Task TestStructWithoutDocumentationAsync()
5159
{
5260
await this.TestTypeWithoutDocumentationAsync("struct", false).ConfigureAwait(false);
5361
}
5462

63+
[Fact]
64+
public async Task TestPartialStructWithoutDocumentationAsync()
65+
{
66+
await this.TestTypeDeclarationDocumentationAsync("struct", "partial", false, false).ConfigureAwait(false);
67+
await this.TestTypeDeclarationDocumentationAsync("struct", "internal partial", false, false).ConfigureAwait(false);
68+
await this.TestTypeDeclarationDocumentationAsync("struct", "public partial", false, false).ConfigureAwait(false);
69+
}
70+
5571
[Fact]
5672
public async Task TestEnumWithoutDocumentationAsync()
5773
{
@@ -64,6 +80,14 @@ public async Task TestInterfaceWithoutDocumentationAsync()
6480
await this.TestTypeWithoutDocumentationAsync("interface", true).ConfigureAwait(false);
6581
}
6682

83+
[Fact]
84+
public async Task TestPartialInterfaceWithoutDocumentationAsync()
85+
{
86+
await this.TestTypeDeclarationDocumentationAsync("interface", "partial", false, false).ConfigureAwait(false);
87+
await this.TestTypeDeclarationDocumentationAsync("interface", "internal partial", false, false).ConfigureAwait(false);
88+
await this.TestTypeDeclarationDocumentationAsync("interface", "public partial", false, false).ConfigureAwait(false);
89+
}
90+
6791
[Fact]
6892
public async Task TestClassWithDocumentationAsync()
6993
{

0 commit comments

Comments
 (0)