Categories: ASP.NET

How To Generate Code Coverage Report in HTML Using *.coverage

In this blog, we are talking about your code coverage file to create an HTML report and send it to the client.

If don’t know about the analysis of test case code coverage. you can watch my previous blog here.

Generate reports

Now that you’re able to collect data from unit test runs, you can generate reports using ReportGenerator. To install the ReportGenerator NuGet package as a .NET global tool, use the dotnet tool install command:

Write command in your project manager console.

dotnet tool install -g dotnet-reportgenerator-globaltool

Run the tool and provide the desired options, given the output *coverage.xml file from the previous test run.

Write this command in your console.

reportgenerator
-reports:"Path\To\TestProject\TestResults\{guid}\coverage.xml"
-targetdir:"coveragereport"
-reporttypes:Html

After running this command, an HTML file represents the generated report. your report HTML file is ‘C:\Users\PCName\coveragereport\index.html’.

In this generated report, you can watch that where your .cs file code is covered or not and any other information. Now, you can send this file to your project manager and they decide to write more test cases or not base on your percentage.

In this blog, we learn how to create a report for your *.covrage file.

I hope you guys understand how I can do this. Let me know if you face any difficulties.

You can watch my previous blog here.

Happy Coding {;} ????

Nayan Raval

Nayan Raval is a MEAN Stack .Net Developer has extensive experience with designing and developing enterprise-scale applications. Key Areas Of Expertise: • ASP.NET Core MVC • ASP.NET Core Web API • C# • ASP.NET MVC 5 • Angular All versions • HTML5 • CSS3 / SCSS • Bootstrap • JavaScript • Azure • JQuery Databases and related • Microsoft SQL server MSSQL • PostgreSQL • Entity Framework (EF) • LINQ UI Frameworks • Kendo UI • Telerik • JQuery UI • Prime NG and Material UI API Integration • SignalR • DateDog • Twilio Voice Call And Message • Stripe • SendGrid (Email Camping) • Checkr • Zoom Video Call • Auth0 • Elastic Search • Quartz - Scheduler • JWT Token • Google Calendar

Recent Posts

Testing hk

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Operation

Testing

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

Create and Used PIPE in angular

In this article, we have to show Create and Used PIPE in angular

2 years ago

TETS NEW

test

2 years ago