# first run the tests with coverage, generating a snapshot
dotcover cover
--targetExecutable="nunit3-console.exe"
--targetArguments="..."
--output="coverage-results.snapshot"
# then, generate the JSON report
dotcover report --Source="results.snapshot" --Output="coverage-results.json" --ReportType="JSON"
# then, generate the HTML report (a nice way of examining results manually)
dotcover report --Source="results.snapshot" --Output="coverage-results.html" --ReportType="HTML"
# Read the JSON file (my runners are on windows, so I'm using powershell)
$coverageJson = (Get-Content "coverage-results.json" -Raw) | ConvertFrom-Json
# Print the top level coverage result
Write-Host "Statements: $($coverageJson.CoveragePercent)%"
Latest posts by Rajesh Kumar (see all)
- An Introduction of GitLab Duo - December 22, 2024
- Best Hospitals for affordable surgery for medical tourism - December 20, 2024
- Top Global Medical Tourism Companies in the World - December 20, 2024