Unit Testing with Visual Studio

Summary

This Drill covers unit testing and testing patterns in Visual Studio. Topics include an introduction to unit testing with Visual Studio, dependency injection, using test stubs, using mock objects, using shared fixtures, and using custom assertions and finder methods. This drill is also available in our Programming with Visual Studio Team System developer program.

Audience

This Drill is for intermediate developers who want to learn how to write effective unit tests using documented test patterns in Visual Studio.

What you'll learn

You will learn how to use the Unit Testing Framework in Visual Studio to create unit tests for your code. After taking this Drill, you will be able to use Visual Studio to create unit tests on a class or method level, access private methods and properties of your code under test, and use the Test View window in Visual Studio to control which tests run. You will also learn how to apply documented testing patterns and techniques.

What you need to know

We assume that you’re already familiar with the concepts of programming and you’ve some experience of Visual Studio 2005/2008. For this Drill, you’ll also need to be comfortable with Visual Basic syntax.