[#VS2012] HowTo: Add the context menu to create Unit Tests (you probably miss this one like me;)



surely fans of the TDD , purists at end and unconditional supporters of the Great Khan not read this post. However, that we live in the limit as the great Logen Nuevededos, we do things the other way around. Also I have used to display the contextual menu and create a UnitTest for a function whenever you need. This is a feature that in Visual Studio 2012 missed. ( If you work with legacy, code you probably know what I mean )

Reading a little this post , I see that in fact this functionality was not removed in VS2012, but it was hidden by default. If you want to do is have it again in your context menu, follow these steps.

1. In VS2012 go to menu Tools / / Customize.

2 Switch to the Commands tab.

3 Select the Context Menu option and the value Editor Context Menus | Code Window.

4. Inside of the options that presents this shortcut menu, see the Create Unit Test option is available, but nevertheless “is not” by default. Only by moving it up or down, we may already have it in our IDE.


5 Done!

A detail, to run the unit tests creation wizard, it is necessary to have a project of Unit Test added to the solution. I have not been able that the wizard create one and Add (my guess is that as they have now changed the types of project, this feature does not have adapted it).

The following links give you more information in this regard.




Saludos @ Home

El Bruno

image image image


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.