Tuesday, March 10, 2009

Unit testing in Visual Studio 2008 Team System

As you probably noticed, VS.NET 2008 comes with unit testing integrated within.

There two ways to create test:

1) From existing, production code

2) Manually

Obviously option 1 requires less work, and I’m going to describe this scenario.

Quick start:

  1. Open your existing project
  2. Right click on the source and select “Create Unit Tests”
  3. Select methods you want to create tests
  4. (Optionally) Change settings (by clicking on “Settings..” button
  5. Click OK to create new test project


After all new test project will be created and added to your solution.


Now you can change run your tests (Menu Test \ Run)

TIP: you can double click on test result record to see more detail view.


What's also very useful: you can also add some brakpoints and start debuging test classes.


Of course auto generated tests are not very valuable there are inconclusive (at least)

You need to change test methods according to unit tests art – but most of dirty work was done by VS!


In next posts I will try explain more about unit testing.


Keep reading!



Labels:

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home