Skip to content

Commit 95d103c

Browse files
committed
Fix expected file paths
1 parent a9e2f03 commit 95d103c

File tree

8 files changed

+41
-41
lines changed

8 files changed

+41
-41
lines changed

StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/DebugMessagesUnitTestsBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public async Task TestConstantMessage_Field_PassWrongTypeAsync()
4848
var endLinePosition = new LinePosition(3, 28);
4949
DiagnosticResult[] expected =
5050
{
51-
DiagnosticResult.CompilerError("CS0029").WithSpan(new FileLinePositionSpan("Test0.cs", startLinePosition, endLinePosition)).WithMessage("Cannot implicitly convert type 'int' to 'string'"),
51+
DiagnosticResult.CompilerError("CS0029").WithSpan(new FileLinePositionSpan("/0/Test0.cs", startLinePosition, endLinePosition)).WithMessage("Cannot implicitly convert type 'int' to 'string'"),
5252
};
5353

5454
await this.TestConstantMessage_Field_PassExecuterAsync("3", expected).ConfigureAwait(false);
@@ -73,7 +73,7 @@ public async Task TestConstantMessage_Local_PassWrongTypeAsync()
7373
var endLinePosition = new LinePosition(5, 32);
7474
DiagnosticResult[] expected =
7575
{
76-
DiagnosticResult.CompilerError("CS0029").WithSpan(new FileLinePositionSpan("Test0.cs", startLinePosition, endLinePosition)).WithMessage("Cannot implicitly convert type 'int' to 'string'"),
76+
DiagnosticResult.CompilerError("CS0029").WithSpan(new FileLinePositionSpan("/0/Test0.cs", startLinePosition, endLinePosition)).WithMessage("Cannot implicitly convert type 'int' to 'string'"),
7777
};
7878

7979
await this.TestConstantMessage_Local_PassExecuterAsync("3", expected).ConfigureAwait(false);
@@ -98,7 +98,7 @@ public async Task TestConstantMessage_Inline_PassWrongTypeAsync()
9898
var endLinePosition = new LinePosition(startLinePosition.Line, startLinePosition.Character + 1);
9999
DiagnosticResult[] expected =
100100
{
101-
DiagnosticResult.CompilerError("CS1503").WithSpan(new FileLinePositionSpan("Test0.cs", startLinePosition, endLinePosition)).WithMessage($"Argument {1 + this.InitialArguments.Count()}: cannot convert from 'int' to 'string'"),
101+
DiagnosticResult.CompilerError("CS1503").WithSpan(new FileLinePositionSpan("/0/Test0.cs", startLinePosition, endLinePosition)).WithMessage($"Argument {1 + this.InitialArguments.Count()}: cannot convert from 'int' to 'string'"),
102102
};
103103

104104
await this.TestConstantMessage_Inline_PassExecuterAsync("3", expected).ConfigureAwait(false);

StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/FileMayOnlyContainTestBase.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public async Task TestTwoElementsAsync()
4848

4949
var fixedCode = new[]
5050
{
51-
("Test0.cs", @"%1 Foo
51+
("/0/Test0.cs", @"%1 Foo
5252
{
5353
}
5454
"),
@@ -91,7 +91,7 @@ public async Task TestThreeElementsAsync()
9191

9292
var fixedCode = new[]
9393
{
94-
("Test0.cs", @"%1 Foo
94+
("/0/Test0.cs", @"%1 Foo
9595
{
9696
}
9797
"),
@@ -141,7 +141,7 @@ public async Task TestRemoveWarningSuppressionAsync()
141141

142142
var fixedCode = new[]
143143
{
144-
("Test0.cs", @"%1 Foo
144+
("/0/Test0.cs", @"%1 Foo
145145
{
146146
}
147147
"),
@@ -185,7 +185,7 @@ public async Task TestPreserveWarningSuppressionAsync()
185185
// See https://github.com/dotnet/roslyn/issues/3999
186186
var fixedCode = new[]
187187
{
188-
("Test0.cs", @"%1 Foo
188+
("/0/Test0.cs", @"%1 Foo
189189
{
190190
}
191191
"),
@@ -226,7 +226,7 @@ public async Task TestRemovePreprocessorDirectivesAsync()
226226

227227
var fixedCode = new[]
228228
{
229-
("Test0.cs", @"%1 Foo
229+
("/0/Test0.cs", @"%1 Foo
230230
{
231231
}
232232
"),
@@ -271,7 +271,7 @@ public async Task TestPreservePreprocessorDirectivesAsync()
271271
// See https://github.com/dotnet/roslyn/issues/3999
272272
var fixedCode = new[]
273273
{
274-
("Test0.cs", @"%1 Foo
274+
("/0/Test0.cs", @"%1 Foo
275275
{
276276
#if true
277277
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/SA1402ForBlockDeclarationUnitTestsBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task TestTwoGenericElementsAsync()
3636

3737
var fixedCode = new[]
3838
{
39-
("Test0.cs", @"%1 Foo<T1>
39+
("/0/Test0.cs", @"%1 Foo<T1>
4040
{
4141
}
4242
"),
@@ -83,7 +83,7 @@ public async Task TestTwoElementsWithDefaultRuleConfigurationAsync()
8383

8484
var fixedCode = new[]
8585
{
86-
("Test0.cs", @"%1 Foo
86+
("/0/Test0.cs", @"%1 Foo
8787
{
8888
}
8989
"),
@@ -133,7 +133,7 @@ public partial {this.Keyword} Bar
133133

134134
var fixedCode = new[]
135135
{
136-
("Test0.cs", $@"public partial {this.Keyword} Foo
136+
("/0/Test0.cs", $@"public partial {this.Keyword} Foo
137137
{{
138138
}}
139139
"),
@@ -159,7 +159,7 @@ public async Task TestPreferFilenameTypeAsync()
159159

160160
var fixedCode = new[]
161161
{
162-
("Test0.cs", $@"public {this.Keyword} Test0
162+
("/0/Test0.cs", $@"public {this.Keyword} Test0
163163
{{
164164
}}"),
165165
("Foo.cs", $@"public {this.Keyword} Foo

StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/SA1402ForDelegateUnitTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public async Task TestTwoElementsAsync()
3030

3131
var fixedCode = new[]
3232
{
33-
("Test0.cs", @"public delegate void Foo();
33+
("/0/Test0.cs", @"public delegate void Foo();
3434
"),
3535
("Bar.cs", @"public delegate void Bar();
3636
"),
@@ -49,7 +49,7 @@ public async Task TestTwoGenericElementsAsync()
4949

5050
var fixedCode = new[]
5151
{
52-
("Test0.cs", @"public delegate void Foo();
52+
("/0/Test0.cs", @"public delegate void Foo();
5353
"),
5454
("Bar.cs", @"public delegate void Bar<T1, T2, T3>(T1 x, T2 y, T3 z);
5555
"),
@@ -93,7 +93,7 @@ public async Task TestThreeElementsAsync()
9393

9494
var fixedCode = new[]
9595
{
96-
("Test0.cs", @"public delegate void Foo();
96+
("/0/Test0.cs", @"public delegate void Foo();
9797
"),
9898
("Bar.cs", @"public delegate void Bar();
9999
"),
@@ -119,7 +119,7 @@ public async Task TestPreferFilenameTypeAsync()
119119

120120
var fixedCode = new[]
121121
{
122-
("Test0.cs", $@"public delegate void Test0();
122+
("/0/Test0.cs", $@"public delegate void Test0();
123123
"),
124124
("Foo.cs", $@"public delegate void Foo();
125125
"),

StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/SA1402ForEnumUnitTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ enum Bar
4040

4141
var fixedCode = new[]
4242
{
43-
("Test0.cs", @"enum Foo
43+
("/0/Test0.cs", @"enum Foo
4444
{
4545
A, B, C
4646
}
@@ -111,7 +111,7 @@ enum FooBar
111111

112112
var fixedCode = new[]
113113
{
114-
("Test0.cs", @"enum Foo
114+
("/0/Test0.cs", @"enum Foo
115115
{
116116
A, B, C
117117
}
@@ -152,7 +152,7 @@ enum Test0
152152

153153
var fixedCode = new[]
154154
{
155-
("Test0.cs", @"enum Test0
155+
("/0/Test0.cs", @"enum Test0
156156
{
157157
D, E
158158
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/SA1412UnitTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ public async Task TestFixAllWithMultipleEncodingsAsync()
9090
},
9191
ExpectedDiagnostics =
9292
{
93-
Diagnostic().WithLocation("Test0.cs", 1, 1),
94-
Diagnostic().WithLocation("Test1.cs", 1, 1),
95-
Diagnostic().WithLocation("Test2.cs", 1, 1),
93+
Diagnostic().WithLocation("/0/Test0.cs", 1, 1),
94+
Diagnostic().WithLocation("/0/Test1.cs", 1, 1),
95+
Diagnostic().WithLocation("/0/Test2.cs", 1, 1),
9696
},
9797
FixedSources =
9898
{
@@ -122,8 +122,8 @@ private async Task TestFixAllExecuterAsync(int codepage, FixAllScope scope)
122122
},
123123
ExpectedDiagnostics =
124124
{
125-
Diagnostic().WithLocation("Test0.cs", 1, 1),
126-
Diagnostic().WithLocation("Test1.cs", 1, 1),
125+
Diagnostic().WithLocation("/0/Test0.cs", 1, 1),
126+
Diagnostic().WithLocation("/0/Test1.cs", 1, 1),
127127
},
128128
FixedSources =
129129
{

StyleCop.Analyzers/StyleCop.Analyzers.Test/OrderingRules/SA1208UnitTests.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ class A
7878
},
7979
ExpectedDiagnostics =
8080
{
81-
Diagnostic().WithLocation("Test2.cs", 2, 1).WithArguments("System", "Xyz"),
82-
Diagnostic().WithLocation("Test2.cs", 3, 1).WithArguments("System.IO", "Xyz"),
83-
Diagnostic().WithLocation("Test2.cs", 5, 1).WithArguments("System.Threading.Tasks", "Xyz"),
81+
Diagnostic().WithLocation("/0/Test2.cs", 2, 1).WithArguments("System", "Xyz"),
82+
Diagnostic().WithLocation("/0/Test2.cs", 3, 1).WithArguments("System.IO", "Xyz"),
83+
Diagnostic().WithLocation("/0/Test2.cs", 5, 1).WithArguments("System.Threading.Tasks", "Xyz"),
8484
},
8585
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
8686
}
@@ -108,8 +108,8 @@ class A
108108
},
109109
ExpectedDiagnostics =
110110
{
111-
Diagnostic().WithLocation("Test2.cs", 4, 5).WithArguments("System.Threading", "Namespace"),
112-
Diagnostic().WithLocation("Test2.cs", 5, 5).WithArguments("System.IO", "Namespace"),
111+
Diagnostic().WithLocation("/0/Test2.cs", 4, 5).WithArguments("System.Threading", "Namespace"),
112+
Diagnostic().WithLocation("/0/Test2.cs", 5, 5).WithArguments("System.IO", "Namespace"),
113113
},
114114
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
115115
}
@@ -141,9 +141,9 @@ class A
141141
},
142142
ExpectedDiagnostics =
143143
{
144-
Diagnostic().WithLocation("Test3.cs", 2, 1).WithArguments("System.IO", "AnotherNamespace"),
145-
Diagnostic().WithLocation("Test3.cs", 8, 5).WithArguments("System.Threading", "Xyz"),
146-
Diagnostic().WithLocation("Test3.cs", 9, 5).WithArguments("System", "Xyz"),
144+
Diagnostic().WithLocation("/0/Test3.cs", 2, 1).WithArguments("System.IO", "AnotherNamespace"),
145+
Diagnostic().WithLocation("/0/Test3.cs", 8, 5).WithArguments("System.Threading", "Xyz"),
146+
Diagnostic().WithLocation("/0/Test3.cs", 9, 5).WithArguments("System", "Xyz"),
147147
},
148148
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
149149
}
@@ -175,7 +175,7 @@ class A
175175
},
176176
ExpectedDiagnostics =
177177
{
178-
Diagnostic().WithLocation("Test3.cs", 8, 5).WithArguments("System.Threading", "Xyz"),
178+
Diagnostic().WithLocation("/0/Test3.cs", 8, 5).WithArguments("System.Threading", "Xyz"),
179179
},
180180
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
181181
}
@@ -216,7 +216,7 @@ class A
216216
},
217217
ExpectedDiagnostics =
218218
{
219-
Diagnostic().WithLocation("Test2.cs", 6, 5).WithArguments("System.IO", "System.IO.Path"),
219+
Diagnostic().WithLocation("/0/Test2.cs", 6, 5).WithArguments("System.IO", "System.IO.Path"),
220220
},
221221
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
222222
}
@@ -271,7 +271,7 @@ class A
271271
},
272272
ExpectedDiagnostics =
273273
{
274-
Diagnostic().WithLocation("Test2.cs", 5, 5).WithArguments("System.Threading", "Namespace"),
274+
Diagnostic().WithLocation("/0/Test2.cs", 5, 5).WithArguments("System.Threading", "Namespace"),
275275
},
276276
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
277277
}
@@ -299,8 +299,8 @@ class A
299299
},
300300
ExpectedDiagnostics =
301301
{
302-
Diagnostic().WithLocation("Test2.cs", 4, 5).WithArguments("System.Threading", "Namespace"),
303-
Diagnostic().WithLocation("Test2.cs", 5, 5).WithArguments("System.IO", "Namespace"),
302+
Diagnostic().WithLocation("/0/Test2.cs", 4, 5).WithArguments("System.Threading", "Namespace"),
303+
Diagnostic().WithLocation("/0/Test2.cs", 5, 5).WithArguments("System.IO", "Namespace"),
304304
},
305305
}.RunAsync(CancellationToken.None).ConfigureAwait(false);
306306
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/OrderingRules/SA1209UnitTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class A
136136
}
137137
}";
138138

139-
DiagnosticResult expected = Diagnostic().WithLocation("Test0.cs", 2, 1);
139+
DiagnosticResult expected = Diagnostic().WithLocation("/0/Test0.cs", 2, 1);
140140

141141
await VerifyCSharpFixAsync(testCode, expected, fixedTestCode, CancellationToken.None).ConfigureAwait(false);
142142
}
@@ -188,7 +188,7 @@ class A
188188
}
189189
}";
190190

191-
DiagnosticResult expected = Diagnostic().WithLocation("Test0.cs", 4, 5);
191+
DiagnosticResult expected = Diagnostic().WithLocation("/0/Test0.cs", 4, 5);
192192

193193
await VerifyCSharpFixAsync(testCode, expected, fixedTestCode, CancellationToken.None).ConfigureAwait(false);
194194
}
@@ -222,7 +222,7 @@ class A
222222
}
223223
}";
224224

225-
DiagnosticResult expected = Diagnostic().WithLocation("Test0.cs", 4, 5);
225+
DiagnosticResult expected = Diagnostic().WithLocation("/0/Test0.cs", 4, 5);
226226

227227
await VerifyCSharpFixAsync(testCode, expected, fixedTestCode, CancellationToken.None).ConfigureAwait(false);
228228
}

0 commit comments

Comments
 (0)