Skip to content

Commit

Permalink
Merge pull request #3269 from sharwell/first-type
Browse files Browse the repository at this point in the history
Check file name for single 'enum' and 'delegate' top-level types
  • Loading branch information
sharwell authored Dec 8, 2020
2 parents d3d46e7 + 37a0ba2 commit 2bf353c
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,88 +3,9 @@

namespace StyleCop.Analyzers.Test.CSharp9.DocumentationRules
{
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp;
using StyleCop.Analyzers.Test.CSharp8.DocumentationRules;
using Xunit;

public class SA1649CSharp9UnitTests : SA1649CSharp8UnitTests
{
public static IEnumerable<object[]> CSharp9TypeKeywords
{
get
{
foreach (var keyword in TypeKeywords)
{
yield return keyword;
}

yield return new object[] { "record", LanguageVersion.CSharp9 };
}
}

[Theory]
[MemberData(nameof(CSharp9TypeKeywords))]
public override async Task VerifyWrongFileNameAsync(string typeKeyword, LanguageVersion languageVersion)
{
await base.VerifyWrongFileNameAsync(typeKeyword, languageVersion).ConfigureAwait(false);
}

[Theory]
[MemberData(nameof(CSharp9TypeKeywords))]
public override async Task VerifyWrongFileNameMultipleExtensionsAsync(string typeKeyword, LanguageVersion languageVersion)
{
await base.VerifyWrongFileNameMultipleExtensionsAsync(typeKeyword, languageVersion).ConfigureAwait(false);
}

[Theory]
[MemberData(nameof(CSharp9TypeKeywords))]
public override async Task VerifyWrongFileNameNoExtensionAsync(string typeKeyword, LanguageVersion languageVersion)
{
await base.VerifyWrongFileNameNoExtensionAsync(typeKeyword, languageVersion).ConfigureAwait(false);
}

[Theory]
[MemberData(nameof(CSharp9TypeKeywords))]
public override async Task VerifyCaseInsensitivityAsync(string typeKeyword, LanguageVersion languageVersion)
{
await base.VerifyCaseInsensitivityAsync(typeKeyword, languageVersion).ConfigureAwait(false);
}

[Theory]
[MemberData(nameof(CSharp9TypeKeywords))]
public override async Task VerifyFirstTypeIsUsedAsync(string typeKeyword, LanguageVersion languageVersion)
{
await base.VerifyFirstTypeIsUsedAsync(typeKeyword, languageVersion).ConfigureAwait(false);
}

[Theory]
[MemberData(nameof(CSharp9TypeKeywords))]
public override async Task VerifyThatPartialTypesAreIgnoredAsync(string typeKeyword, LanguageVersion languageVersion)
{
await base.VerifyThatPartialTypesAreIgnoredAsync(typeKeyword, languageVersion).ConfigureAwait(false);
}

[Theory]
[MemberData(nameof(CSharp9TypeKeywords))]
public override async Task VerifyStyleCopNamingConventionForGenericTypeAsync(string typeKeyword, LanguageVersion languageVersion)
{
await base.VerifyStyleCopNamingConventionForGenericTypeAsync(typeKeyword, languageVersion).ConfigureAwait(false);
}

[Theory]
[MemberData(nameof(CSharp9TypeKeywords))]
public override async Task VerifyMetadataNamingConventionForGenericTypeAsync(string typeKeyword, LanguageVersion languageVersion)
{
await base.VerifyMetadataNamingConventionForGenericTypeAsync(typeKeyword, languageVersion).ConfigureAwait(false);
}

[Theory]
[MemberData(nameof(CSharp9TypeKeywords))]
public override async Task VerifyMetadataNamingConventionForGenericTypeMultipleExtensionsAsync(string typeKeyword, LanguageVersion languageVersion)
{
await base.VerifyMetadataNamingConventionForGenericTypeMultipleExtensionsAsync(typeKeyword, languageVersion).ConfigureAwait(false);
}
}
}
Loading

0 comments on commit 2bf353c

Please sign in to comment.