One complaint made by new users of Visual Studio Team System 2005 (Tester, Developer and Suite) is that when they have a Visual C# Project and they select "Create Unit Tests" from the context menu, the Test Project is created by default in VB, and not in C#.

image

To change this behavior it's really simple. In the Tools menu select Options, and then Test Tools, Test Project:

image

The first option is the default test project type. When "Visual C# test projects" is selected, the default language in the wizard will be C#.

Another complaint that I often receive is that users only want to create the Unit Tests that they've selected, and not also the Manual Test (or other test types). Unselecting unwanted test types (and also the "About Test Projects") will remove them from new projects (they can also be created later).

These options are available depending on the installed version of Visual Studio (for example Database Unit Test is available only when VSTE for Database Professionals is installed).

Visual Studio 2008 (Professional and Team System editions) has another option, that automatically creates a test project using the language of the production code (this works with "Create Unit Tests", the default language for normal Test Project creation is still selected using the combo-box).

image

As you can see, Visual Basic is the default language, but the default for the Test Project is in the same language of the code under test.

image

Another unknown feature (available both in VSTS2005 and VS2008) is the ability to filter methods in the Create Unit Tests form. You can select to display non-public items, base types or your code only.

Visual Studio Options are full of interesting items, I really suggest to explore them.

Technorati Tags: ,