For those who are disappointed with the removal of the "Create Unit Tests..." context menu in Visual Studio 2012, here are few methods for you to re-enable the feature:
Method 1 - Command Window If you find hard enough, you will discover that the command to invoke the Create Unit Tests... is actually: EditorContextMenus.CodeWindow.CreateUnitTests You can actually type that in the Command Window to invoke the Create Unit Test Wizard. If you find it too verbose, you can actually create an alias for it. alias ut EditorContextMenus.CodeWindow.CreateUnitTests Then just type ut to launch the wizard.
Method 2 - Keyboard Shortcut The next method is to go to Tools->Options->Environment->Keyboard and set a shortcut key of your preference.
Method 3 - Re-enable the Create Unit Tests... Context Menu. This is by far the best method ever. To re-enable the Create Unit Tests... menu, go to Tools->Customize... to launch the Customize dialog. At the Customize dialog, go to the Commands tab, select the Context menu radio button and choose Editor Context Menus | Code Window.
Thanks to our MVP Serena Yeoh for sharing such a great information with us, you can click here to see the full details.
Definitely voting to bring back this feature to VS2012.
Voting is being considered already:
Your re-post missed the most important part of the original blog:
You may discover that using any of the above methods may not work. i.e. The Command Window will tell you that the command is not available, the keyboard shortcut will not fire or the Context menu will be available but disabled.
To allow all these to work, you will first need to have a Unit Test Project in your solution. After creating the Unit Test Project, you will need to manually Add a Unit Test item to the project even though the project unfolds with one on its own. After you have done this, everything will function as it is like back in Visual Studio 2010. You can safely remove those UnitTest1.cs files.
Thanks full post and michael freidgei's work around to enable create unit test helped me a lot.
There seems to be a step missing in "Method 3"
I see the "Create Unit Test" option in the customize window as shown in the screenshot... but do I need to do something to it to enable it?
were you able to enable "Create Unit Test"? I still can not figure out how to enable it.
If you use the link at the bottom of the post it has more information. You have to move the unit test up and then down, close, and restart the program.
I got it to work. But... How can I test non static methods? The wizard only sees static methods.