Skip to content

Commit fa32e52

Browse files
committed
Add regression test for SA1313
1 parent 2198e7f commit fa32e52

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/NamingRules/SA1313UnitTests.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,37 @@ public void MethodName(int _)
474474
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
475475
}
476476

477+
/// <summary>
478+
/// This is a regression test for DotNetAnalyzers/StyleCopAnalyzers#1529:
479+
/// https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/1529
480+
/// </summary>
481+
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
482+
[Fact]
483+
public async Task TestInheritedInterfacesWithOverloadedMembersAsync()
484+
{
485+
var testCode = @"
486+
public interface ITest
487+
{
488+
void Method(int Param1, int param2, int Param3);
489+
void Method();
490+
}
491+
492+
public interface IEmptyInterface { }
493+
494+
public interface IDerivedTest : ITest, IEmptyInterface
495+
{
496+
void Method(int Param1, int param2, int param3);
497+
}";
498+
var expected = new[]
499+
{
500+
this.CSharpDiagnostic().WithLocation(4, 21).WithArguments("Param1"),
501+
this.CSharpDiagnostic().WithLocation(4, 45).WithArguments("Param3"),
502+
this.CSharpDiagnostic().WithLocation(12, 21).WithArguments("Param1"),
503+
};
504+
505+
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
506+
}
507+
477508
protected override IEnumerable<DiagnosticAnalyzer> GetCSharpDiagnosticAnalyzers()
478509
{
479510
yield return new SA1313ParameterNamesMustBeginWithLowerCaseLetter();

0 commit comments

Comments
 (0)