views:

30

answers:

2

I've just started using MSTest in a Visual Studio project (NUnit has been what I've used before) and I have a few questions.

I see that if I right-click on a single test method and choose run tests, it'll test that one method. Good. But is there a way I can set up a test run that only does x of my tests of my choosing, instead of all y of them? I've looked under the test menu and the options in it but I can't figure out how to do this.

Also, how can I debug a subset of my tests? Right now if I debug my MSTest project all of them are run. Sorry for the beginner's questions, I've been kicking around the menu options but nothing has come to me on these issues. Thanks!

+3  A: 

Visual Studio allows creating test lists, which does exactly what you want. See here: http://msdn.microsoft.com/en-us/library/ms182462.aspx

Also this link may be useful: http://freekleemhuis.com/2008/04/20/unit-testing-in-visual-studio-2008-part-1/

Konamiman
Thanks to both of you for the tips. I did create a test list, but couldn't figure out how to get my tests into it...these articles will help.
larryq
+2  A: 

Kona is right for a list you wish to maintain; I find a lot of the time I don't need a list that stands the test of time, just one I can run for the next few minutes/hours.

In that scenario, I use the Test View window, highlight what you I to run (CTRL + Left Click for multiples) and press the run button.

Kindness,

Dan

Daniel Elliott