Skip to content

Commit fbeef56

Browse files
Generalize tests for SA1600 concerning partial types
1 parent ce89120 commit fbeef56

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

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

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,13 @@ public async Task TestBaseTypeWithDocumentationAsync(string type)
5656
await this.TestTypeWithDocumentationAsync(type).ConfigureAwait(false);
5757
}
5858

59-
[Fact]
60-
public async Task TestPartialClassWithoutDocumentationAsync()
61-
{
62-
await this.TestTypeDeclarationDocumentationAsync("class", "partial", false, false).ConfigureAwait(false);
63-
await this.TestTypeDeclarationDocumentationAsync("class", "internal partial", false, false).ConfigureAwait(false);
64-
await this.TestTypeDeclarationDocumentationAsync("class", "public partial", false, false).ConfigureAwait(false);
65-
}
66-
67-
[Fact]
68-
public async Task TestPartialStructWithoutDocumentationAsync()
69-
{
70-
await this.TestTypeDeclarationDocumentationAsync("struct", "partial", false, false).ConfigureAwait(false);
71-
await this.TestTypeDeclarationDocumentationAsync("struct", "internal partial", false, false).ConfigureAwait(false);
72-
await this.TestTypeDeclarationDocumentationAsync("struct", "public partial", false, false).ConfigureAwait(false);
73-
}
74-
75-
[Fact]
76-
public async Task TestPartialInterfaceWithoutDocumentationAsync()
59+
[Theory]
60+
[MemberData(nameof(CommonMemberData.TypeDeclarationKeywords), MemberType = typeof(CommonMemberData))]
61+
public async Task TestPartialTypeWithoutDocumentationAsync(string type)
7762
{
78-
await this.TestTypeDeclarationDocumentationAsync("interface", "partial", false, false).ConfigureAwait(false);
79-
await this.TestTypeDeclarationDocumentationAsync("interface", "internal partial", false, false).ConfigureAwait(false);
80-
await this.TestTypeDeclarationDocumentationAsync("interface", "public partial", false, false).ConfigureAwait(false);
63+
await this.TestTypeDeclarationDocumentationAsync(type, "partial", false, false).ConfigureAwait(false);
64+
await this.TestTypeDeclarationDocumentationAsync(type, "internal partial", false, false).ConfigureAwait(false);
65+
await this.TestTypeDeclarationDocumentationAsync(type, "public partial", false, false).ConfigureAwait(false);
8166
}
8267

8368
[Fact]

0 commit comments

Comments
 (0)