“Create Unit Tests…” Function Not Available Or Disabled

If you followed my two blog posts previously (Create Unit Tests Workaround and Solution), you may found out at some point of time, the function of “Create Unit Tests” wizard is disabled on your next attempt to launch the Create Unit Tests wizard.

The following issues were encountered:

  1. When you used Keyboard Shortcut workaround, the Create Unit Tests Wizard does not appear.
  2. You may receive the following error while using the Command Window workaround:
    Command "EditorContextMenus.CodeWindow.CreateUnitTests" is not available.

    Command "EditorContextMenus.CodeWindow.CreateUnitTests" is not available.
    Command “EditorContextMenus.CodeWindow.CreateUnitTests” is not available.
  3.  Right-Click “Create Unit Tests…” menu is disabled or grayed out when you use either solutions.

    "Create Unit Tests..." menu disabled
    “Create Unit Tests…” menu disabled

This is a known issue and the below solution will solve the problem.


Read more“Create Unit Tests…” Function Not Available Or Disabled

Enable “Create Unit Tests…” on Visual Studio 2012

Update: If you are having issues with the “Create Unit Tests…” function being disabled, check out this post.

If you have followed from my previous workaround to enable “Create Unit Tests…”, you might be delighted that there’s a permanent solution to this issue.

There are two ways to fully enable “Create Unit Tests…” on Visual Studio 2012 without using keyboard shortcuts or command window. Better still, you can now right click –> Create Unit Tests… as could be seen below:

"Create Unit Tests..." menu enabled
“Create Unit Tests…” menu enabled

There are two ways to enable this, the elegant way or the abnormal way.

Solution 1: The Elegant Way

Read moreEnable “Create Unit Tests…” on Visual Studio 2012

Enable “Create Unit Tests…” Workaround on Visual Studio 2012

Update: A better solution posted! Check out this post!

As you might have known, Visual Studio Team has decided to depreciate this functionality in Visual Studio 2012. Excerpt from Visual Studio Team blog:

Generate Unit Test Wizard – In VS2010 you could right click on a method in your code and we would generate a unit test into your test project. This wizard was very tightly coupled to MS-Test and depended on features like Private Accessors to do its work, so it was cut. We are exploring alternatives here, but don’t have any good solutions yet.

What does this mean?

It means that those who survived with MS-Test will now have to create unit tests manually. On the other hand, they have yet to come out with a solution here. But it seem like this causes furore from developers community who voiced out their opinion to bring back “Create Unit Tests…” functionality.

There are several alternative methods to bring back this function back into Visual Studio 2012. Fortunately, Visual Studio Team has yet to fully eliminate “CreateUnitTests” from the latest Visual Studio (as of VS 2012 Update 1). After some ample research and sheer perseverance, a few workarounds and solution are created. I will start off with workarounds first, and with permanent solution in my next blog post.

Workaround 1: Keyboard Shortcut

Read moreEnable “Create Unit Tests…” Workaround on Visual Studio 2012