-
Notifications
You must be signed in to change notification settings - Fork 0
Dot Net Core Test Coverage
clydeu edited this page Jun 6, 2019
·
2 revisions
Pre-Requisites:
-
Install NuGet CLI.
-
Make sure you test project is using NuGet Package References:
Right-click the References node in Solution Explorer and select Migrate packages.config to PackageReference�.
-
Install NuGet packages
You need to run the following command, in a temporary folder that can be removed once it is installed, to install both packages in NuGet cache:
nuget install OpenCovernuget install ReportGenerator
-
Install dotnet testx
dotnet tool install --global dotnet-testx -
Enable full PDB generation for all projects you want included in the coverage report (no longer needed for net standard projects):
Project->Properties->Build->Advanced->Debugging information
- Open Powershell/CMD/Git Bash in test project folder.
- Run
dotnet testx --html --browser. - Or if need to run multiple tests,
dotnet testx --html --browser --discover-projects *tests.csprojin the solution folder. - Optionally,
dotnet watch testx --htmlcan be used to watch test file changes.
For UI coverage: https://github.com/ppumkin/PrestoCoverage