@@ -34,7 +34,7 @@ private ClonedTemplateProject PrepareTemplateProject()
34
34
public void TestMsbuild ( )
35
35
{
36
36
using ClonedTemplateProject clonedTemplateProject = PrepareTemplateProject ( ) ;
37
- bool result = DotnetCli ( $ "test -c { _buildConfiguration } -f { _buildTargetFramework } \" { clonedTemplateProject . ProjectRootPath } \" /p:CollectCoverage=true /p:Include=\" [{ ClonedTemplateProject . AssemblyName } ]*DeepThought\" /p:IncludeTestAssembly=true /p:CoverletOutput=\" { clonedTemplateProject . ProjectRootPath } \" \\ ", out string standardOutput , out string standardError ) ;
37
+ int result = DotnetCli ( $ "test -c { _buildConfiguration } -f { _buildTargetFramework } \" { clonedTemplateProject . ProjectRootPath } \" /p:CollectCoverage=true /p:Include=\" [{ ClonedTemplateProject . AssemblyName } ]*DeepThought\" /p:IncludeTestAssembly=true /p:CoverletOutput=\" { clonedTemplateProject . ProjectRootPath } \" \\ ", out string standardOutput , out string standardError ) ;
38
38
if ( ! string . IsNullOrEmpty ( standardError ) )
39
39
{
40
40
_output . WriteLine ( standardError ) ;
@@ -43,7 +43,7 @@ public void TestMsbuild()
43
43
{
44
44
_output . WriteLine ( standardOutput ) ;
45
45
}
46
- Assert . True ( result ) ;
46
+ Assert . Equal ( 0 , result ) ;
47
47
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
48
48
Assert . Contains ( "| coverletsamplelib.integration.template | 100% | 100% | 100% |" , standardOutput , StringComparison . Ordinal ) ;
49
49
string coverageFileName = $ "coverage.{ _buildTargetFramework } .json";
@@ -55,7 +55,7 @@ public void TestMsbuild()
55
55
public void TestMsbuild_NoCoverletOutput ( )
56
56
{
57
57
using ClonedTemplateProject clonedTemplateProject = PrepareTemplateProject ( ) ;
58
- bool result = DotnetCli ( $ "test -c { _buildConfiguration } -f { _buildTargetFramework } \" { clonedTemplateProject . ProjectRootPath } \" /p:CollectCoverage=true /p:Include=\" [{ ClonedTemplateProject . AssemblyName } ]*DeepThought\" /p:IncludeTestAssembly=true", out string standardOutput , out string standardError ) ;
58
+ int result = DotnetCli ( $ "test -c { _buildConfiguration } -f { _buildTargetFramework } \" { clonedTemplateProject . ProjectRootPath } \" /p:CollectCoverage=true /p:Include=\" [{ ClonedTemplateProject . AssemblyName } ]*DeepThought\" /p:IncludeTestAssembly=true", out string standardOutput , out string standardError ) ;
59
59
if ( ! string . IsNullOrEmpty ( standardError ) )
60
60
{
61
61
_output . WriteLine ( standardError ) ;
@@ -64,7 +64,7 @@ public void TestMsbuild_NoCoverletOutput()
64
64
{
65
65
_output . WriteLine ( standardOutput ) ;
66
66
}
67
- Assert . True ( result ) ;
67
+ Assert . Equal ( 0 , result ) ;
68
68
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
69
69
Assert . Contains ( "| coverletsamplelib.integration.template | 100% | 100% | 100% |" , standardOutput , StringComparison . Ordinal ) ;
70
70
string coverageFileName = $ "coverage.{ _buildTargetFramework } .json";
@@ -76,7 +76,7 @@ public void TestMsbuild_NoCoverletOutput()
76
76
public void TestMsbuild_CoverletOutput_Folder_FileNameWithoutExtension ( )
77
77
{
78
78
using ClonedTemplateProject clonedTemplateProject = PrepareTemplateProject ( ) ;
79
- bool result = DotnetCli ( $ "test -c { _buildConfiguration } -f { _buildTargetFramework } \" { clonedTemplateProject . ProjectRootPath } \" /p:CollectCoverage=true /p:Include=\" [{ ClonedTemplateProject . AssemblyName } ]*DeepThought\" /p:IncludeTestAssembly=true /p:CoverletOutput=\" { clonedTemplateProject . ProjectRootPath } \" \\ file", out string standardOutput , out string standardError ) ;
79
+ int result = DotnetCli ( $ "test -c { _buildConfiguration } -f { _buildTargetFramework } \" { clonedTemplateProject . ProjectRootPath } \" /p:CollectCoverage=true /p:Include=\" [{ ClonedTemplateProject . AssemblyName } ]*DeepThought\" /p:IncludeTestAssembly=true /p:CoverletOutput=\" { clonedTemplateProject . ProjectRootPath } \" \\ file", out string standardOutput , out string standardError ) ;
80
80
if ( ! string . IsNullOrEmpty ( standardError ) )
81
81
{
82
82
_output . WriteLine ( standardError ) ;
@@ -85,7 +85,8 @@ public void TestMsbuild_CoverletOutput_Folder_FileNameWithoutExtension()
85
85
{
86
86
_output . WriteLine ( standardOutput ) ;
87
87
}
88
- Assert . True ( result ) ; Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
88
+ Assert . Equal ( 0 , result ) ;
89
+ Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
89
90
Assert . Contains ( "| coverletsamplelib.integration.template | 100% | 100% | 100% |" , standardOutput , StringComparison . Ordinal ) ;
90
91
string coverageFileName = $ "file.{ _buildTargetFramework } .json";
91
92
Assert . True ( File . Exists ( Path . Combine ( clonedTemplateProject . ProjectRootPath , coverageFileName ) ) ) ;
@@ -96,7 +97,7 @@ public void TestMsbuild_CoverletOutput_Folder_FileNameWithoutExtension()
96
97
public void TestMsbuild_CoverletOutput_Folder_FileNameExtension ( )
97
98
{
98
99
using ClonedTemplateProject clonedTemplateProject = PrepareTemplateProject ( ) ;
99
- Assert . True ( 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 ) , standardOutput ) ;
100
+ 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 ) ) ;
100
101
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
101
102
Assert . Contains ( "| coverletsamplelib.integration.template | 100% | 100% | 100% |" , standardOutput , StringComparison . Ordinal ) ;
102
103
string coverageFileName = $ "file.{ _buildTargetFramework } .ext";
@@ -179,7 +180,7 @@ public void Test_MultipleTargetFrameworkReport_CoverletOutput_Folder()
179
180
using ClonedTemplateProject clonedTemplateProject = PrepareTemplateProject ( ) ;
180
181
string [ ] targetFrameworks = new string [ ] { "net6.0" , "net8.0" } ;
181
182
UpdateProjectTargetFramework ( clonedTemplateProject , targetFrameworks ) ;
182
- bool result = DotnetCli ( $ "test -c { _buildConfiguration } \" { clonedTemplateProject . ProjectRootPath } \" /p:CollectCoverage=true /p:Include=\" [{ ClonedTemplateProject . AssemblyName } ]*DeepThought\" /p:IncludeTestAssembly=true /p:CoverletOutput=\" { clonedTemplateProject . ProjectRootPath } \" \\ ", out string standardOutput , out string standardError , clonedTemplateProject . ProjectRootPath ! ) ;
183
+ int result = DotnetCli ( $ "test -c { _buildConfiguration } \" { clonedTemplateProject . ProjectRootPath } \" /p:CollectCoverage=true /p:Include=\" [{ ClonedTemplateProject . AssemblyName } ]*DeepThought\" /p:IncludeTestAssembly=true /p:CoverletOutput=\" { clonedTemplateProject . ProjectRootPath } \" \\ ", out string standardOutput , out string standardError , clonedTemplateProject . ProjectRootPath ! ) ;
183
184
if ( ! string . IsNullOrEmpty ( standardError ) )
184
185
{
185
186
_output . WriteLine ( standardError ) ;
@@ -188,7 +189,7 @@ public void Test_MultipleTargetFrameworkReport_CoverletOutput_Folder()
188
189
{
189
190
_output . WriteLine ( standardOutput ) ;
190
191
}
191
- Assert . True ( result ) ;
192
+ Assert . Equal ( 0 , result ) ;
192
193
Assert . Contains ( "Passed!" , standardOutput , StringComparison . Ordinal ) ;
193
194
Assert . Contains ( "| coverletsamplelib.integration.template | 100% | 100% | 100% |" , standardOutput , StringComparison . Ordinal ) ;
194
195
0 commit comments