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 . OrderingRules
75{
86 using System . Threading ;
97 using System . Threading . Tasks ;
108 using Microsoft . CodeAnalysis . Testing ;
9+ using StyleCop . Analyzers . Test . Helpers ;
1110 using Xunit ;
1211 using static StyleCop . Analyzers . Test . Verifiers . StyleCopCodeFixVerifier <
1312 StyleCop . Analyzers . OrderingRules . SA1212PropertyAccessorsMustFollowOrder ,
1413 StyleCop . Analyzers . OrderingRules . SA1212SA1213CodeFixProvider > ;
1514
1615 public class SA1212UnitTests
1716 {
18- [ Fact ]
19- public async Task TestPropertyWithDocumentationAsync ( )
17+ [ Theory ]
18+ [ InlineData ( "\n " ) ]
19+ [ InlineData ( "\r \n " ) ]
20+ public async Task TestPropertyWithDocumentationAsync ( string lineEnding )
2021 {
2122 var testCode = @"
2223public class Foo
@@ -28,10 +29,10 @@ public int Prop
2829 /// <summary>
2930 /// The setter documentation
3031 /// </summary>
31- set
32+ {|#0: set
3233 {
3334 i = value;
34- }
35+ }|}
3536
3637 /// <summary>
3738 /// The getter documentation
@@ -41,9 +42,9 @@ public int Prop
4142 return i;
4243 }
4344 }
44- }" ;
45+ }" . ReplaceLineEndings ( lineEnding ) ;
4546
46- DiagnosticResult expected = Diagnostic ( ) . WithLocation ( 11 , 9 ) ;
47+ DiagnosticResult expected = Diagnostic ( ) . WithLocation ( 0 ) ;
4748
4849 var fixedCode = @"
4950public class Foo
@@ -68,7 +69,7 @@ public int Prop
6869 i = value;
6970 }
7071 }
71- }" ;
72+ }" . ReplaceLineEndings ( lineEnding ) ;
7273
7374 await VerifyCSharpFixAsync ( testCode , expected , fixedCode , CancellationToken . None ) . ConfigureAwait ( false ) ;
7475 }
0 commit comments