Using VS Code, Coverlet, xUnit, plus these extensions
- Coverage Gutters
- Reads in the lcov.info file (name matters) and highlights lines with color
- .NET Core Test Explorer
- Discovers tests and gives you a nice explorer.
- Coverlet
- The start of .NET Core Code Coverage
Note the tasks.json, specifically this part. If you name the file lcov.info, the Coverage Gutters extension will pick up and color the line numbers.
{
"label": "test with coverage",
"command": "dotnet",
"type": "process",
"args": [
"test",
"/p:CollectCoverage=true",
"/p:CoverletOutputFormat=lcov",
"/p:CoverletOutput=./lcov.info",
"${workspaceFolder}/The.Tests/The.Tests.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "test",
"isDefault": true
}
},