Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I continuously run unit tests in Visual Studio 2012 Professional?

Tags:

Visual Studio 2012 added a "Run tests after build" button in the Unit Test Explorer, but it seems that option is not available in the Professional edition. In fact, my "Unit Test Explorer" is just called "Test Explorer", and doesn't have that button at all:

Screenshot of Test Explorer window

Are there any extensions which can replace this missing feature? Something that integrates with the existing test explorer UI would be ideal. (Free options are also preferred, since if I could convince my corporate overlords to shell out for VS Ultimate/Premium, this wouldn't be an issue anyway)

like image 385
Brant Bobby Avatar asked Nov 21 '12 17:11

Brant Bobby


People also ask

How do I run all unit tests in Visual Studio?

To run all the tests in a default group, choose the Run icon and then choose the group on the menu. Select the individual tests that you want to run, open the right-click menu for a selected test and then choose Run Selected Tests (or press Ctrl + R, T).

How do I automate unit testing in Visual Studio?

To generate unit tests, your types must be public. Open your solution in Visual Studio and then open the class file that has methods you want to test. Right-click on a method and choose Run IntelliTest to generate unit tests for the code in your method. IntelliTest runs your code many times with different inputs.


1 Answers

I remapped my F6 key to TestExplorer.RunAllTests instead of the default of Build.BuildSolution

Build.BuildSolution gets remapped to Ctrl-Shift-B when you do that.

It works well because now my F6 reflex RunAllTests saves any modified files, builds my solution and runs my unit tests.

The only thing I had to change is my window layout so that I can see the Test Explorer Window, that way I know if any tests failed.

Updating the answer with a link to a blog I wrote about this

like image 116
Jason Learmouth Avatar answered Oct 21 '22 16:10

Jason Learmouth