You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor coverage file validation in integration tests
Centralize coverage output validation in CollectCoverageTests via a new CheckCoverageResult helper. This improves robustness by checking output directory existence, file presence, and format-specific content for both JSON and Cobertura XML. Updated test methods to use this helper, added a constant for LCOV file name, and adjusted output path structure. Removed redundant assertions in favor of unified checks.
@@ -71,12 +76,7 @@ public async Task BasicCoverage_CollectsDataForCoveredLines()
71
76
Assert.True(result.ExitCode==0,$"Expected successful test run (exit code 0) but got {result.ExitCode} -> '{result.ErrorText}'.\n\n{result.CombinedOutput}");
@@ -96,12 +96,7 @@ public async Task CoverageWithFormat_GeneratesCorrectOutputFormat()
96
96
// Assert
97
97
Assert.True(result.ExitCode==0,$"Expected successful test run (exit code 0) but got {result.ExitCode} -> '{result.ErrorText}'.\n\n{result.CombinedOutput}");
@@ -119,6 +114,8 @@ public async Task CoverageInstrumentation_TracksMethodHits()
119
114
// Assert
120
115
Assert.True(result.ExitCode==0,$"Expected successful test run (exit code 0) but got {result.ExitCode} -> '{result.ErrorText}'.\n\n{result.CombinedOutput}");
@@ -172,6 +169,8 @@ public async Task BranchCoverage_TracksConditionalPaths()
172
169
// Assert
173
170
Assert.True(result.ExitCode==0,$"Expected successful test run (exit code 0) but got {result.ExitCode} -> '{result.ErrorText}'.\n\n{result.CombinedOutput}");
@@ -229,10 +228,75 @@ public async Task MultipleCoverageFormats_GeneratesAllReports()
229
228
// Assert
230
229
Assert.True(result.ExitCode==0,$"Expected successful test run (exit code 0) but got {result.ExitCode} -> '{result.ErrorText}'.\n\n{result.CombinedOutput}");
0 commit comments