@@ -21,20 +21,20 @@ public class SA1600UnitTests
2121 protected virtual LanguageVersion LanguageVersion => LanguageVersion . CSharp6 ;
2222
2323 [ Theory ]
24- [ InlineData ( "public string TestMember;" , 15 ) ]
25- [ InlineData ( "public string TestMember { get; set; }" , 15 ) ]
26- [ InlineData ( "public void TestMember() { }" , 13 ) ]
27- [ InlineData ( "public string this[int a] { get { return \" a\" ; } set { } }" , 15 ) ]
28- [ InlineData ( "public event EventHandler TestMember { add { } remove { } }" , 27 ) ]
29- public async Task TestRegressionMethodGlobalNamespaceAsync ( string code , int column )
24+ [ InlineData ( "public string {|#0: TestMember|};" ) ]
25+ [ InlineData ( "public string {|#0: TestMember|} { get; set; }" ) ]
26+ [ InlineData ( "public void {|#0: TestMember|} () { }" ) ]
27+ [ InlineData ( "public string {|#0: this|} [int a] { get { return \" a\" ; } set { } }" ) ]
28+ [ InlineData ( "public event EventHandler {|#0: TestMember|} { add { } remove { } }" ) ]
29+ public async Task TestRegressionMethodGlobalNamespaceAsync ( string code )
3030 {
3131 // This test is a regression test for https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/1416
3232 var testCode = $@ "
3333using System;
3434
3535{ code } ";
3636
37- var expected = this . GetExpectedResultTestRegressionMethodGlobalNamespace ( code , column ) ;
37+ var expected = this . GetExpectedResultTestRegressionMethodGlobalNamespace ( code ) ;
3838 await VerifyCSharpDiagnosticAsync ( this . LanguageVersion , testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
3939 }
4040
@@ -1384,12 +1384,12 @@ public class OuterClass
13841384 await VerifyCSharpDiagnosticAsync ( this . LanguageVersion , string . Format ( hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation , modifiers ) , requiresDiagnostic ? expected : DiagnosticResult . EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
13851385 }
13861386
1387- protected virtual DiagnosticResult [ ] GetExpectedResultTestRegressionMethodGlobalNamespace ( string code , int column )
1387+ protected virtual DiagnosticResult [ ] GetExpectedResultTestRegressionMethodGlobalNamespace ( string code )
13881388 {
13891389 return new [ ]
13901390 {
1391- DiagnosticResult . CompilerError ( "CS0116" ) . WithMessage ( "A namespace cannot directly contain members such as fields or methods" ) . WithLocation ( 4 , column ) ,
1392- Diagnostic ( ) . WithLocation ( 4 , column ) ,
1391+ DiagnosticResult . CompilerError ( "CS0116" ) . WithMessage ( "A namespace cannot directly contain members such as fields or methods" ) . WithLocation ( 0 ) ,
1392+ Diagnostic ( ) . WithLocation ( 0 ) ,
13931393 } ;
13941394 }
13951395
0 commit comments