How to run Unit Tests in Visual Studio?
NUnit does not currently have a plugin for Visual Studio that allows you to run test right from Visual Studio. However, it can be done.
You can use a number of tools but the tool I prefer is TestDriven.NET.
Step 1 – Download and Installation
- Go to the TestDriven.NET web site.
- Click the download link.
- Download the appropriate version (Enterprise, Professional, or Personal).
- Close Visual Studio.
- Install TestDriven.NET.
Step 2 – Running Unit Tests
- Open your solution that has a test project in Visual Studio.
- Right-click on your test project and you should see a Run Test(s) and a Test With option.
- Select Run Test(s).
You are now running tests just by right-clicking in Visual Studio.
Notice that you can also run tests in the Debugger and with Coverage and with Performance.
Thanks for this article. I needed a quick rundown on getting unit tests started. I was debating doing MSTest but decided to go with with Nunit. For your next blog post how about a simple Ling to Entities tutorial 🙂