Skip to content

Commit 2b565d4

Browse files
committed
Convert remaining SpacingRules tests to the new test helpers
1 parent bd82367 commit 2b565d4

42 files changed

Lines changed: 2317 additions & 2904 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/SpacingRules/SA1003CSharp7UnitTests.cs

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ namespace StyleCop.Analyzers.Test.CSharp7.SpacingRules
1010
using Xunit;
1111

1212
using static StyleCop.Analyzers.SpacingRules.SA1003SymbolsMustBeSpacedCorrectly;
13+
using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier<
14+
StyleCop.Analyzers.SpacingRules.SA1003SymbolsMustBeSpacedCorrectly,
15+
StyleCop.Analyzers.SpacingRules.SA1003CodeFixProvider>;
1316

1417
public class SA1003CSharp7UnitTests : SA1003UnitTests
1518
{
@@ -62,33 +65,32 @@ public void Method()
6265
";
6366
DiagnosticResult[] expected =
6467
{
65-
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(9, 20).WithArguments("=>"),
66-
this.CSharpDiagnostic(DescriptorFollowedByWhitespace).WithLocation(9, 20).WithArguments("=>"),
68+
Diagnostic(DescriptorPrecededByWhitespace).WithLocation(9, 20).WithArguments("=>"),
69+
Diagnostic(DescriptorFollowedByWhitespace).WithLocation(9, 20).WithArguments("=>"),
6770

68-
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(10, 14).WithArguments("=>"),
69-
this.CSharpDiagnostic(DescriptorFollowedByWhitespace).WithLocation(10, 14).WithArguments("=>"),
71+
Diagnostic(DescriptorPrecededByWhitespace).WithLocation(10, 14).WithArguments("=>"),
72+
Diagnostic(DescriptorFollowedByWhitespace).WithLocation(10, 14).WithArguments("=>"),
7073

71-
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(11, 42).WithArguments("=>"),
72-
this.CSharpDiagnostic(DescriptorFollowedByWhitespace).WithLocation(11, 42).WithArguments("=>"),
73-
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(11, 62).WithArguments("=>"),
74-
this.CSharpDiagnostic(DescriptorFollowedByWhitespace).WithLocation(11, 62).WithArguments("=>"),
74+
Diagnostic(DescriptorPrecededByWhitespace).WithLocation(11, 42).WithArguments("=>"),
75+
Diagnostic(DescriptorFollowedByWhitespace).WithLocation(11, 42).WithArguments("=>"),
76+
Diagnostic(DescriptorPrecededByWhitespace).WithLocation(11, 62).WithArguments("=>"),
77+
Diagnostic(DescriptorFollowedByWhitespace).WithLocation(11, 62).WithArguments("=>"),
7578

76-
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(12, 32).WithArguments("=>"),
77-
this.CSharpDiagnostic(DescriptorFollowedByWhitespace).WithLocation(12, 32).WithArguments("=>"),
78-
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(12, 41).WithArguments("=>"),
79-
this.CSharpDiagnostic(DescriptorFollowedByWhitespace).WithLocation(12, 41).WithArguments("=>"),
79+
Diagnostic(DescriptorPrecededByWhitespace).WithLocation(12, 32).WithArguments("=>"),
80+
Diagnostic(DescriptorFollowedByWhitespace).WithLocation(12, 32).WithArguments("=>"),
81+
Diagnostic(DescriptorPrecededByWhitespace).WithLocation(12, 41).WithArguments("=>"),
82+
Diagnostic(DescriptorFollowedByWhitespace).WithLocation(12, 41).WithArguments("=>"),
8083

81-
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(13, 41).WithArguments("=>"),
82-
this.CSharpDiagnostic(DescriptorFollowedByWhitespace).WithLocation(13, 41).WithArguments("=>"),
83-
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(13, 50).WithArguments("=>"),
84-
this.CSharpDiagnostic(DescriptorFollowedByWhitespace).WithLocation(13, 50).WithArguments("=>"),
84+
Diagnostic(DescriptorPrecededByWhitespace).WithLocation(13, 41).WithArguments("=>"),
85+
Diagnostic(DescriptorFollowedByWhitespace).WithLocation(13, 41).WithArguments("=>"),
86+
Diagnostic(DescriptorPrecededByWhitespace).WithLocation(13, 50).WithArguments("=>"),
87+
Diagnostic(DescriptorFollowedByWhitespace).WithLocation(13, 50).WithArguments("=>"),
8588

86-
this.CSharpDiagnostic(DescriptorPrecededByWhitespace).WithLocation(16, 32).WithArguments("=>"),
87-
this.CSharpDiagnostic(DescriptorFollowedByWhitespace).WithLocation(16, 32).WithArguments("=>"),
89+
Diagnostic(DescriptorPrecededByWhitespace).WithLocation(16, 32).WithArguments("=>"),
90+
Diagnostic(DescriptorFollowedByWhitespace).WithLocation(16, 32).WithArguments("=>"),
8891
};
8992

90-
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
91-
await this.VerifyCSharpFixAsync(testCode, fixedTestCode).ConfigureAwait(false);
93+
await VerifyCSharpFixAsync(testCode, expected, fixedTestCode, CancellationToken.None).ConfigureAwait(false);
9294
}
9395
}
9496
}

0 commit comments

Comments
 (0)