Skip to content

Commit e137b57

Browse files
committed
Added test for SA1115 (Parameter must begin on next line) where there is a #pragma directive between two parameters.
1 parent 9876971 commit e137b57

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/ReadabilityRules/SA1115UnitTests.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,31 @@ public void Baz()
179179
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
180180
}
181181

182+
[Fact]
183+
public async Task TestMethodCallPragmaDirectiveBetweenParametersAsync()
184+
{
185+
var testCode = @"
186+
class Foo
187+
{
188+
public void Bar(int i, int z)
189+
{
190+
}
191+
192+
public void Baz()
193+
{
194+
Bar(
195+
#pragma warning disable CS4014
196+
1,
197+
#pragma warning restore CS4014
198+
2);
199+
}
200+
}";
201+
202+
DiagnosticResult[] expected = EmptyDiagnosticResults;
203+
204+
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
205+
}
206+
182207
[Fact]
183208
public async Task TestMethodCallSecondParameterOnTheNextLineAsync()
184209
{

0 commit comments

Comments
 (0)