@@ -14,6 +14,7 @@ public class Msbuild : BaseTest
14
14
private readonly string _buildConfiguration ;
15
15
private readonly string _buildTargetFramework ;
16
16
private readonly ITestOutputHelper _output ;
17
+ private static readonly string _expectedResult = "| coverletsamplelib.integration.template | 50 % | 100 % | 50 % |" ;
17
18
18
19
public Msbuild ( ITestOutputHelper output )
19
20
{
@@ -45,7 +46,7 @@ public void TestMsbuild()
45
46
}
46
47
Assert . Equal ( 0 , result ) ;
47
48
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
48
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
49
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
49
50
string coverageFileName = $ "coverage.json";
50
51
Assert . True ( File . Exists ( Path . Combine ( clonedTemplateProject . ProjectRootPath , coverageFileName ) ) ) ;
51
52
AssertCoverage ( clonedTemplateProject , coverageFileName ) ;
@@ -66,7 +67,7 @@ public void TestMsbuild_NoCoverletOutput()
66
67
}
67
68
Assert . Equal ( 0 , result ) ;
68
69
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
69
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
70
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
70
71
string coverageFileName = $ "coverage.json";
71
72
Assert . True ( File . Exists ( Path . Combine ( clonedTemplateProject . ProjectRootPath , coverageFileName ) ) ) ;
72
73
AssertCoverage ( clonedTemplateProject , coverageFileName ) ;
@@ -87,7 +88,7 @@ public void TestMsbuild_CoverletOutput_Folder_FileNameWithoutExtension()
87
88
}
88
89
Assert . Equal ( 0 , result ) ;
89
90
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
90
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
91
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
91
92
string coverageFileName = $ "file.json";
92
93
Assert . True ( File . Exists ( Path . Combine ( clonedTemplateProject . ProjectRootPath , coverageFileName ) ) ) ;
93
94
AssertCoverage ( clonedTemplateProject , coverageFileName ) ;
@@ -99,7 +100,7 @@ public void TestMsbuild_CoverletOutput_Folder_FileNameExtension()
99
100
using ClonedTemplateProject clonedTemplateProject = PrepareTemplateProject ( ) ;
100
101
Assert . Equal ( 0 , DotnetCli ( $ "test -c { _buildConfiguration } -f { _buildTargetFramework } \" { clonedTemplateProject . ProjectRootPath } \" /p:CollectCoverage=true /p:Include=\" [{ ClonedTemplateProject . AssemblyName } ]*DeepThought\" /p:IncludeTestAssembly=true /p:CoverletOutput=\" { clonedTemplateProject . ProjectRootPath } \" \\ file.ext", out string standardOutput , out string standardError ) ) ;
101
102
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
102
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
103
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
103
104
string coverageFileName = $ "file.ext";
104
105
Assert . True ( File . Exists ( Path . Combine ( clonedTemplateProject . ProjectRootPath , coverageFileName ) ) ) ;
105
106
AssertCoverage ( clonedTemplateProject , coverageFileName ) ;
@@ -123,7 +124,7 @@ public void TestMsbuild_CoverletOutput_Folder_FileNameExtension_SpecifyFramework
123
124
_output . WriteLine ( standardOutput ) ;
124
125
}
125
126
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
126
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
127
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
127
128
Assert . True ( File . Exists ( Path . Combine ( clonedTemplateProject . ProjectRootPath , "file.ext" ) ) ) ;
128
129
AssertCoverage ( clonedTemplateProject , "file.ext" ) ;
129
130
}
@@ -142,7 +143,7 @@ public void TestMsbuild_CoverletOutput_Folder_FileNameWithDoubleExtension()
142
143
_output . WriteLine ( standardOutput ) ;
143
144
}
144
145
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
145
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
146
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
146
147
string coverageFileName = $ "file.ext1.ext2";
147
148
Assert . True ( File . Exists ( Path . Combine ( clonedTemplateProject . ProjectRootPath , coverageFileName ) ) ) ;
148
149
AssertCoverage ( clonedTemplateProject , coverageFileName ) ;
@@ -164,7 +165,7 @@ public void Test_MultipleTargetFrameworkReport_NoCoverletOutput()
164
165
_output . WriteLine ( standardOutput ) ;
165
166
}
166
167
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
167
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
168
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
168
169
169
170
foreach ( string targetFramework in targetFrameworks )
170
171
{
@@ -191,7 +192,7 @@ public void Test_MultipleTargetFrameworkReport_CoverletOutput_Folder()
191
192
}
192
193
Assert . Equal ( 0 , result ) ;
193
194
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
194
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
195
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
195
196
196
197
foreach ( string targetFramework in targetFrameworks )
197
198
{
@@ -218,7 +219,7 @@ public void Test_MultipleTargetFrameworkReport_CoverletOutput_Folder_FileNameWit
218
219
_output . WriteLine ( standardOutput ) ;
219
220
}
220
221
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
221
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
222
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
222
223
223
224
foreach ( string targetFramework in targetFrameworks )
224
225
{
@@ -248,7 +249,7 @@ public void Test_MultipleTargetFrameworkReport_CoverletOutput_Folder_FileNameWit
248
249
_output . WriteLine ( standardOutput ) ;
249
250
}
250
251
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
251
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
252
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
252
253
253
254
foreach ( string targetFramework in targetFrameworks )
254
255
{
@@ -281,7 +282,7 @@ public void Test_MultipleTargetFrameworkReport_CoverletOutput_Folder_FileNameWit
281
282
_output . WriteLine ( standardOutput ) ;
282
283
}
283
284
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
284
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
285
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
285
286
286
287
foreach ( string targetFramework in targetFrameworks )
287
288
{
@@ -307,7 +308,7 @@ public void Test_MultipleTargetFrameworkReport_CoverletOutput_Folder_FileNameWit
307
308
_output . WriteLine ( standardOutput ) ;
308
309
}
309
310
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
310
- Assert . Contains ( "| coverletsamplelib.integration.template | 50% | 100% | 50% | ", standardOutput , StringComparison . Ordinal ) ;
311
+ Assert . Contains ( $ " { _expectedResult } ", standardOutput , StringComparison . Ordinal ) ;
311
312
312
313
foreach ( string targetFramework in targetFrameworks )
313
314
{
0 commit comments