Idiot level guide to using nUnit with dotCover

Please could someone post very simple instructions on how o integrate nUnit and dotCover?

I have an existing class library project containing many nUnit tests, but I can't see how to integrate this with dotCover to see my code coverage?

0
5 comments

Dave,

If you are using Resharper and dotCover, it's crazy easy.  Resharper provides a unit test runner which integrates with dotCover.  Choose the green dot in the left hand margin of the code window that contains your test.  Click "Cover with dotCover".

But if you're not using Resharper, then I think what you do is from VS, choose dotCover->Cover Application->Standalone Application->OK.  In the application field put the full path to nunit.exe.  (Which is the nUnit gui).  Choose OK, and nunit will launch.  From here proceed normally (add your assemblies, run the tests, etc).

Hope that helps,
Josh

0
Avatar
Permanently deleted user

I've tried both nUnit GUI and nUnit console and the same thing happens for both:

The dotCover Controller window launches.

nUnit launches - if GUI then click "Run", if console then tests run automatically.

nUnit closes

dotCover controller window closes and results window opens

Either way, the results window shows no code coverage at all.  It is correctly showing the assemblies that my unit tests are hitting, but zero coverage?

0

@Josh:
Thank you for the detailed and correct answer.

@Dave:
Are the coverage results matched with the current solution structure? (there is an option in the toolbar)
Does the class library you are testing have PDBs?

0
Avatar
Permanently deleted user

I'm profiling the Debug build and all pdb's are in the debug folder.

The coverage results match my solution - its just that all coverage is marked 0%.

0

Ok, few more ideas:
1) You can disable project structure matching in order to see list of all assemblies included into report.
2) Please check that 'profile child processes' option is turned on (see screenshot)
3) Finally you can check that console unit test runner actually runs tests with given command line and working directory (there are no configuration errors)



Attachment(s):
profile_child_processes.png
0

Please sign in to leave a comment.