

Asp reports code#
When tests are run we gather code coverage information and publish it in Cobertura output format. To generate reports we need coverage data and this is why we added coverlet.msbuild package to test project. Here we are going in smaller scale of course. There can be hundreds or thousands of files depending on how many tests there are in test projects. It’s not just two or three files that are easy to ignore.

The number of files in Coverage folder is not small. gitignore file because I don’t want these files to wander from one developer box to another and be part of commits. UnitTests – unit tests reports (for future use).Coverage – for coverage reports (this blog post).I decided to keep reports in BuildReports folder of test project.
Asp reports install#
Here’s the command line to install ReportGenerator to tools folder (open command line and move to unit tests project folder): dotnet tool install dotnet-reportgenerator-globaltool -tool-path toolsĪfter adding these packages it’s time to make test build and see if everything still works and we don’t have any build issues. I went with external tool because reports are then generated without any dependencies to project binaries. Other options failed for me as ReportGenerator works with. NB! The most painless way to get ReportGenerator work was using local tool. We also need some NuGet packages to make things work: Add reference to web application project and write some unit tests if you start with new test project. To get started we need test project and some NuGet packages. I needed code coverage reports in some of my projects and here is how I made things work using different free libraries and packages. Code coverage reports for ASP.NET Core projects are not provided out-of-box but using right tools we can build decent code coverage reports.
