@@ -8,6 +8,9 @@ namespace StyleCop.Analyzers.Test.CSharp7.SpacingRules
88 using StyleCop . Analyzers . Test . SpacingRules ;
99 using TestHelper ;
1010 using Xunit ;
11+ using static StyleCop . Analyzers . Test . Verifiers . StyleCopCodeFixVerifier <
12+ StyleCop . Analyzers . SpacingRules . SA1001CommasMustBeSpacedCorrectly ,
13+ StyleCop . Analyzers . SpacingRules . TokenSpacingCodeFixProvider > ;
1114
1215 public class SA1001CSharp7UnitTests : SA1001UnitTests
1316 {
@@ -43,15 +46,13 @@ public class Foo
4346
4447 DiagnosticResult [ ] expected =
4548 {
46- this . CSharpDiagnostic ( ) . WithLocation ( 5 , 19 ) . WithArguments ( " not" , "preceded" ) ,
47- this . CSharpDiagnostic ( ) . WithLocation ( 5 , 47 ) . WithArguments ( " not" , "preceded" ) ,
48- this . CSharpDiagnostic ( ) . WithLocation ( 7 , 16 ) . WithArguments ( " not" , "preceded" ) ,
49- this . CSharpDiagnostic ( ) . WithLocation ( 7 , 65 ) . WithArguments ( " not" , "preceded" ) ,
49+ Diagnostic ( ) . WithLocation ( 5 , 19 ) . WithArguments ( " not" , "preceded" ) ,
50+ Diagnostic ( ) . WithLocation ( 5 , 47 ) . WithArguments ( " not" , "preceded" ) ,
51+ Diagnostic ( ) . WithLocation ( 7 , 16 ) . WithArguments ( " not" , "preceded" ) ,
52+ Diagnostic ( ) . WithLocation ( 7 , 65 ) . WithArguments ( " not" , "preceded" ) ,
5053 } ;
5154
52- await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
53- await this . VerifyCSharpDiagnosticAsync ( fixedCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
54- await this . VerifyCSharpFixAsync ( testCode , fixedCode , cancellationToken : CancellationToken . None ) . ConfigureAwait ( false ) ;
55+ await VerifyCSharpFixAsync ( testCode , expected , fixedCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
5556 }
5657
5758 /// <summary>
@@ -82,11 +83,8 @@ public void TestMethod()
8283 }
8384}" ;
8485
85- DiagnosticResult expected = this . CSharpDiagnostic ( ) . WithLocation ( 7 , 34 ) . WithArguments ( " not" , "preceded" ) ;
86-
87- await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
88- await this . VerifyCSharpDiagnosticAsync ( fixedCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
89- await this . VerifyCSharpFixAsync ( testCode , fixedCode , cancellationToken : CancellationToken . None ) . ConfigureAwait ( false ) ;
86+ DiagnosticResult expected = Diagnostic ( ) . WithLocation ( 7 , 34 ) . WithArguments ( " not" , "preceded" ) ;
87+ await VerifyCSharpFixAsync ( testCode , expected , fixedCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
9088 }
9189
9290 /// <summary>
@@ -117,11 +115,8 @@ public void TestMethod()
117115 }
118116}" ;
119117
120- DiagnosticResult expected = this . CSharpDiagnostic ( ) . WithLocation ( 7 , 21 ) . WithArguments ( " not" , "preceded" ) ;
121-
122- await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
123- await this . VerifyCSharpDiagnosticAsync ( fixedCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
124- await this . VerifyCSharpFixAsync ( testCode , fixedCode , cancellationToken : CancellationToken . None ) . ConfigureAwait ( false ) ;
118+ DiagnosticResult expected = Diagnostic ( ) . WithLocation ( 7 , 21 ) . WithArguments ( " not" , "preceded" ) ;
119+ await VerifyCSharpFixAsync ( testCode , expected , fixedCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
125120 }
126121 }
127122}
0 commit comments