title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
FOR ENTERTAINMENT PURPOSES ONLY!!!
Back-up your data and, when you bike, always wear white. As an Amazon Associate, I earn from qualifying purchases. Affiliate links in green. |
|
Wednesday, May 07, 2025 | |
Coverage reports in C# with Cobertura In the last contract I completed, we were building WebAPI microservices in C#, and part of our build process was to run all of our XUnit (and, depending on who originally wrote the microservice, maybe NUnit) tests and use SonarCloud to produce a pretty amazingly specific coverage report that highlighted every source file's test status, line-by-line. I've got a personal project in C#, have been spending time recently writing tests for it, and wondered if I could pull off the same level of coverage testing. Turns out I can! Exactly the same! Install by adding a ref to the coverlet collector to your testing proj:
Then run the test with this:
And sure enough, there's a new folder with every run in my Now the XML isn't very interesting.
You have to turn that into a more interesting report. This Stackoverflow answer explains how:
From the README: Install:
Run:
which, in my case, if I'm already in the same folder as the
... which, because we said so in the options, creates a folder named And then that report looks incredible: I have no idea why I redacted so much of that. Also note this is running against a very early stage piece of code. This coverage is obviously horrendous. But the coverage report isn't! posted by Jalindrine at 5/07/2025 05:47:00 PM |
|
| |
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
![]() |
|
|