Unit Testing

From anywhere in the code editor, you can literally right-click and Visual Studio Team System will generate unit tests for your code (Figure 1). As shown in Figure 2, you have the option of generating unit tests for only the method that you have selected, or all methods in that class, or even all classes in that namespace.

Unit tests are specially decorated classes and methods that Visual Studio Team System can identify with its testing infrastructure. Unit tests can be generated in Visual Basic .NET, Visual C# or Visual C++ (C++/CLI).

Visual Studio Team System was designed with the vision of helping developers to write quality code early and often; quality unit testing is a key way of implementing that vision.

Figure 1 - Generating a unit test

Figure 2 - Generating unit tests for namespaces, class or methods

Figure 3 - Automatically generated unit test code