Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code coverage with nUnit? [closed]

Is there a way to see the code coverage when using nUnit? I know there's such a feature in Visual Studio, but can you use it with nUnit or only with the built-in vs unit tests?

like image 637
Lieven Cardoen Avatar asked Nov 17 '09 09:11

Lieven Cardoen


People also ask

Is NUnit a code coverage tool?

A) Jenkins B) None of the options C) Nunit D) Cobertura. Cobertura is a code coverage tool. This is actually a code coverage utility tool developed specifically for Java.

What is test coverage in NUnit?

Coverage analysis of unit tests For example, MSTest uses test-methods FQNs but NUnit uses properties of test attributes as test IDs. dotCover helps discover and run, debug or cover unit tests right in Visual Studio or using the command-line utility.

How do I enable analyze code coverage in Visual Studio 2022?

Starting in Visual Studio 2022 Update 2, you can enable faster code coverage test results by selecting Tools > Options > Environment > Preview Features, then selecting Code coverage experience improvements, and then restarting Visual Studio.

How do I see the code coverage code in Visual Studio?

To analyze Code Coverage on unit tests in Test Explorer: On the Test menu, choose Analyze Code Coverage. To see which lines have been run, choose Show Code Coverage Coloring Icon Show Code Coverage Coloring.


1 Answers

You can use NCover. Now its commercial, but version 1.5.8 (at the bottom of page, community edition) is still free and if you want to visualize it, then use NCoverExplorer.

EDIT:

It's possible to wrap nUnit or mbUnit with Visual Studio code as well. VSTS Code Coverage Runner

like image 67
Marek Tihkan Avatar answered Nov 14 '22 13:11

Marek Tihkan