Freigeben über


Test Impact View in VS 2010 Beta 2

There are a lot of blog postings around that tell you how to set up Test Impact View for VS 2010. Unfortunately, most of them are out of date, explaining how to do it using the CTP bits from last year, or the Beta 1 bits from earlier this year.

Here’s how to do it in Beta 2, using a simple example:

1. Create a C# console application with a public function int Foo()

2. Create a test project & unit test the method Foo()

3. Enable Test Impact in test settings (double-click the Local.testsettings file under the Solution Items folder in your solution to bring up the settings UI > Data and Diagnostics > Check the Test Impact checkbox)

4. Build the solution locally (not a TFS build)

5. In the editor, right click on the name of the method being tested (in our case, Foo()) > Show Calling Tests > TIV says nothing tests that method

6. Run the unit test by hand from the Test View , and the test has to PASS one time <— this is crucial. Until the test passes that one time, it won’t show up in TIV

7. Now you can right-click on the method being tested > Show Calling Tests > TIV displays the unit test in its list

8. Make a change in the console app method Foo()

9. Build local

10. TIV correctly indicates that the test is impacted

 

That’s it. Make sure you do step #6. The unit test has to complete with a “Pass” one time to establish the internal “wiring,” and you’re golden from then on. The test won’t show up in TIV until after the first time it passes.

Enjoy.

-bliz