Skip to content

Commit 67323ee

Browse files
authored
Merge pull request #2671 from dlemstra/SA1119
Enabled unit tests (#2398).
2 parents 5710f3f + 6651791 commit 67323ee

1 file changed

Lines changed: 4 additions & 22 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/MaintainabilityRules/SA1119CSharp7UnitTests.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ namespace StyleCop.Analyzers.Test.CSharp7.MaintainabilityRules
1212
public class SA1119CSharp7UnitTests : SA1119UnitTests
1313
{
1414
/// <summary>
15-
/// Verifies that extra parentheses in pattern matching are reported.
15+
/// Verifies that extra parentheses in pattern matching is not reported.
1616
/// </summary>
1717
/// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
1818
/// <seealso cref="SA1408CSharp7UnitTests.TestPatternMatchingAsync"/>
19-
[Fact(Skip = "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2398")]
19+
[Fact]
20+
[WorkItem(2372, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2398")]
2021
public async Task TestPatternMatchingAsync()
2122
{
2223
var testCode = @"public class Foo
@@ -29,27 +30,8 @@ public void Bar()
2930
}
3031
}
3132
}";
32-
var fixedCode = @"public class Foo
33-
{
34-
public void Bar()
35-
{
36-
if (new object() is bool b && b)
37-
{
38-
return;
39-
}
40-
}
41-
}";
42-
43-
DiagnosticResult[] expected =
44-
{
45-
this.CSharpDiagnostic(DiagnosticId).WithLocation(5, 13),
46-
this.CSharpDiagnostic(ParenthesesDiagnosticId).WithLocation(5, 13),
47-
this.CSharpDiagnostic(ParenthesesDiagnosticId).WithLocation(5, 36),
48-
};
4933

50-
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
51-
await this.VerifyCSharpDiagnosticAsync(fixedCode, EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
52-
await this.VerifyCSharpFixAsync(testCode, fixedCode).ConfigureAwait(false);
34+
await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
5335
}
5436

5537
[Fact]

0 commit comments

Comments
 (0)