11// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
22// Licensed under the MIT License. See LICENSE in the project root for license information.
33
4- #nullable disable
5-
64namespace StyleCop . Analyzers . Test . CSharp7 . NamingRules
75{
86 using System . Threading ;
@@ -16,30 +14,14 @@ namespace StyleCop.Analyzers.Test.CSharp7.NamingRules
1614
1715 public partial class SA1300CSharp7UnitTests : SA1300UnitTests
1816 {
19- [ Fact ]
20- public async Task TestUpperCaseLocalFunctionAsync ( )
21- {
22- var testCode = @"public class TestClass
23- {
24- public void Method()
25- {
26- void LocalFunction()
27- {
28- }
29- }
30- }" ;
31-
32- await VerifyCSharpDiagnosticAsync ( testCode , DiagnosticResult . EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
33- }
34-
3517 [ Fact ]
3618 public async Task TestLowerCaseLocalFunctionAsync ( )
3719 {
3820 var testCode = @"public class TestClass
3921{
4022 public void Method()
4123 {
42- void localFunction()
24+ void {|#0: localFunction|} ()
4325 {
4426 }
4527 }
@@ -54,7 +36,7 @@ void LocalFunction()
5436 }
5537}" ;
5638
57- DiagnosticResult expected = Diagnostic ( ) . WithArguments ( "localFunction" ) . WithLocation ( 5 , 14 ) ;
39+ DiagnosticResult expected = Diagnostic ( ) . WithArguments ( "localFunction" ) . WithLocation ( 0 ) ;
5840 await VerifyCSharpFixAsync ( testCode , expected , fixedCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
5941 }
6042
@@ -66,7 +48,7 @@ public async Task TestLowerCaseLocalFunctionWithConflictAsync()
6648{
6749 public void Method()
6850 {
69- void localFunction()
51+ void {|#0: localFunction|} ()
7052 {
7153 }
7254
@@ -85,7 +67,7 @@ void LocalFunction1()
8567 }
8668}" ;
8769
88- DiagnosticResult expected = Diagnostic ( ) . WithArguments ( "localFunction" ) . WithLocation ( 5 , 14 ) ;
70+ DiagnosticResult expected = Diagnostic ( ) . WithArguments ( "localFunction" ) . WithLocation ( 0 ) ;
8971 await VerifyCSharpFixAsync ( testCode , expected , fixedCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
9072 }
9173 }
0 commit comments