Foods Make Your Meals Powerful

A perfect meal contains necessary nutrients which we skip most of the time when we eat junk food, and don’t pay attention to the right & healthy meals. Meals are incomplete without condiments. So…


独家优惠奖金 100% 高达 1 BTC + 180 免费旋转

Code coverage with Coverlet for .NET

Code coverage measures how much of your source code is executed while tests are running, the measurement result is represented in percentage, and one or more coverage criteria are used as rules which tests must satisfy.

Why measure code coverage? Doing that assures you that the program with a higher code coverage percentage will have a lower chance of undetected bugs.

Sciensoft.Hateoas Sonarcloud code coverage report.

Coverlet supports coverage results in several formats. The output format can be configured by CoverletOutputFormat property with values: json (default), lcov, opencover, cobertura, and teamcity.

It also supports VSTest and MSBuild type of integration, plus its own coverlet dotnet tool.

To get the advantage of Coverlet with MSBuild, you have only to add coverlet.msbuild to your test projects.

IMPORTANT: Only add the package reference to the test projects.

You will find the packages below in your project file.

Once added, you have to run your tests, passing some parameters to the test tool.

It will produce the typical test output plus the coverage results, as shown:

Coverlet coverage results.

That’s all, and happy testing!

If you also want to push your code coverage to SonarQube, check this other article out:

Add a comment

Related posts:

GuildFi Bersyon 1.5 Update

Ang GuildFi Version 1.5 o GuildFi V1.5 update ay nagpapahusay sa karanasan ng user para sa parehong mga user ng GuildFi platform, gayundin sa aming mga kasosyo sa laro. Una, na-upgrade namin ang…

Telling a story through multimedia

Since my last journal post, I have conducted my final interview for this story on the rock climbing and how its entered mainstream health and wellness in San Diego. The interview took place inside of…

Prototype the right solution

It looks like we are almost reaching the end. However, there still exist many details we need to review, and polish our solution. Although I met an excellent group I believe, the most perfect group…