Re-activating the create unit test function in Visual Studio 2012

Visual studio 2010 had a quick rightclick context menu to create unit test which has disappeared in VS2012, to move to a more general approach that isnt directly tied in with the MS unit testing system. It is possible however to re-enable the menu function or use a keyboard shortcut.

full writeup source: http://serena-yeoh.blogspot.nl/2013/02/visual-studio-2012-create-unit-test.html
http://blogs.msdn.com/b/malaysia/archive/2013/02/20/right-click-create-unit-tests.aspx

Your millage may very with the above methods. While bringing back the menu seems to work for most installs, some never regain the unit test menu. In this case the most safe solution is aliasing the command to a shortcut:

  • Add a unit test project to the solution, AND manualy add unit test to it
  • bring up the command window and type: alias ut EditorContextMenus.CodeWindow.CreateUnitTests