unit-testing Guide unit testing in Visual Studio for C# Running code coverage analysis within Visual Studio

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

  • To see you unit tests go to Test -> Windows -> Code Coverage Results
  • (Figure 1)

enter image description here

  • It will open the following window
  • (Figure 2)

enter image description here

  • The window is now empty
  • Go to the Test menu -> Analyze Code Coverage
  • (Figure 3)

enter image description here

  • The tests will now be run as well (See the results in the Test Explorer)
  • The results will be shown in a table in with you can see which classes and methods are covered with unit tests and which aren’t
  • (Figure 4)

enter image description here



Got any unit-testing Question?