Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run an NUnit test in VisualStudio with OpenCover code coverage?

I am new to NUnit testing. I was able to write test cases for my functions, now what I want is to know the code coverage for my test cases. For that I use OpenCover. But I don't know how to install and get OpenCover to work with Visual Studio 2015, can anyone guide me to install OpenCover for Visual Studio and provide help to see the code coverage in Visual Studio?

like image 319
akhil kumar Avatar asked Mar 29 '17 09:03

akhil kumar


1 Answers

The best solution I found for code coverage in Visual Studio is as follows:

  1. Open Visual Studio 2017
  2. Go to Tools->Extensions and Updates
  3. Go to "Online", in the search (top right of the window) type "AxoCover"
  4. Click install, follow the instructions (i.e. close Visual Studio to start the install)
  5. Reopen Visual Studio
  6. Build your project
  7. Go to Tools->AxoCover
  8. Under the "Tests" tab right click your top directory and go "Cover tests"
  9. Click on the "Report" tab

AxoCover

like image 122
EM-Creations Avatar answered Sep 28 '22 05:09

EM-Creations