

NET tools.Īnd now, it's time to install the actual Visual Studio extension. These commands install ReportGenerator alongside global. To install it, open the PowerShell with admin privileges and run the following commands:ĭotnet tool install -g dotnet-reportgenerator-globaltoolĭotnet tool install dotnet-reportgenerator-globaltool -tool-path toolsĭotnet tool install dotnet-reportgenerator-globaltool

The tool we're gonna use is ReportGenerator, that provides support for projects based on. The next step is to install in Visual Studio an extension that, given the code coverage report, displays the result in a human-readable format. Installing code coverage collector on Visual Studio 2019 This package relies on the MSBuild tool to collect code coverage data and statistics, and save them into a specific file that can be opened with other tools or applications. So, add it with the NuGet package manager or with the CLI, running the command dotnet add package coverlet.msbuild. You must add Coverlet.msbuild to every test project in your solution. The first thing to do to add code coverage reports to our project is to install Coverlet, a NuGet package, whose documentation can be accessed on GitHub. The code and the tests are pretty straightforward but have we really covered the Replace method with enough tests to be sure not to have missed something? Coverlet - the NuGet Package for code coverage
