Skip to content

Commit 88deb37

Browse files
Updated existing test cases for SA1205:
- One to verify code fix for non-nested types without access modifiers. - One to verify that nested interfaces with access modifiers do not trigger the diagnostic. (Simplified test somewhat to make this possible.)
1 parent 7a2006a commit 88deb37

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/OrderingRules/SA1205UnitTests.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public async Task TestInvalidDeclarationAsync(string declaration)
8686

8787
await this.VerifyCSharpDiagnosticAsync(testCode, this.CSharpDiagnostic().WithLocation(1, 2 + declaration.Length), CancellationToken.None).ConfigureAwait(false);
8888
await this.VerifyCSharpDiagnosticAsync(fixedTestCode, EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
89+
await this.VerifyCSharpFixAsync(testCode, fixedTestCode).ConfigureAwait(false);
8990
}
9091

9192
/// <summary>
@@ -180,17 +181,18 @@ public partial class Foo
180181
[InlineData("internal", "struct")]
181182
[InlineData("protected internal", "struct")]
182183
[InlineData("private", "struct")]
184+
[InlineData("public", "interface")]
185+
[InlineData("protected", "interface")]
186+
[InlineData("internal", "interface")]
187+
[InlineData("protected internal", "interface")]
188+
[InlineData("private", "interface")]
183189
public async Task TestNestedTypeAccessModifiersAsync(string accessModifier, string typeKeyword)
184190
{
185191
var testCode = $@"
186192
internal static partial class TestPartial
187193
{{
188194
{accessModifier} partial {typeKeyword} PartialInner
189195
{{
190-
public int Do()
191-
{{
192-
return 2;
193-
}}
194196
}}
195197
}}
196198
";

0 commit comments

Comments
 (0)