The test suite is using xUnit as testing framework and for Code Coverage the test suite uses Corvelet, Corvelet.MSBuild
Required VSCode extensions for code coverage and line coverage
- Coverage Gutters
- .Net Test Explorer
Note Dont forget to activate the Coverage Glutter Watch in the bottom option line in VSCode to see line coverage colors in the code.
dotnet test /p:CollectCoverage=true
dotnet tool install -g dotnet-reportgenerator-globaltool
dotnet tool list --global
Inside .src/ directory execute:
reportgenerator "-reports:coverage/lcov.info" "-reporttypes:HTMLInline;Badges" "-targetdir:coverage/report"
Then Press F1 in VSCode and choose Coverage Gutters: Preview Report Coverage
Install VSCode .Net Test Explorer extension and add this configuration in settings.json
{
"dotnet-test-explorer.testProjectPath": "./src/ByteDecoder.Common.Tests/ByteDecoder.Common.Tests.csproj",
"dotnet-test-explorer.testArguments": "/p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=../coverage/lcov.info"
}
In the Nuget palette you can choose the next options to be displayed:
- Coverage Gutters: Display Coverage
- Coverage Gutters: Preview Report Coverage
https://mookiefumi.com/2019-10-23-unit-testing-tools-using-your-vscode
https://mookiefumi.com/2019-10-20-unit-testing-tools-using-your-MacOS-terminal