Use test categories rather than test lists (vsmdi files)

Buck Hodges

Years ago, I posted an msbuild task to run tests without test lists for VSTS 2005.  That functionality made it into VSTS 2008.  Then Pierre Greborio added support for test categories.  That test category capability is now available in VS 2010.  Using test categories is now the preferred way of running groups of tests, and you no longer need to deal with tests lists (.vsmdi files), which are tedious to maintain and very difficult to merge.

Here’s the documentation on MSDN to show you how to make use of test categories in the 2010 release.

Defining Test Categories to Group Your Tests

If you have created automated tests using Microsoft Visual Studio 2010, you can manage these tests by categorizing them with test categories. When you run these automated tests using Visual Studio, Team Foundation Build, or mstest.exe, you can use these test categories to easily select which tests you run. You add test categories as attributes to your test methods.

Test categories provide more flexibility than the test lists functionality from earlier versions of Microsoft Visual Studio. You can use logical operators with test categories to run tests from multiple categories together or to limit the tests that you run to tests that belong to multiple categories. Also test categories are easy to add as you create your test methods and you do not have to maintain test lists after you have created your test methods. By using test categories, you do not have to check in and check out the <solution name>.vsmdi file that maintains the test lists.

more…

Technorati Tags: ,

0 comments

Leave a comment

Feedback usabilla icon