views:

67

answers:

3

I'm writing and running my tests on VS2010 with mstest. When I want to run a test, or entire tests in a class, sometimes Visual Studio decides to run all my tests.

Why is that? How can I avoid it? Any tips?

A: 

right click in the body of a single test and select 'run tests' should only run that test

Nathan
"should" yeah i know it should.. but not would..sometimes it is
Chen Kinnrot
@Chen: I agree with the "should"!
Nam Gi VU
A: 

I have the same problem. My temporary solution at the moment is:

  1. Open Test List Editor.
  2. Type in your test method name in the filter box and filter it.
  3. Check the tests that you want to run.
  4. Right click and select "Run checked tests"

But I prefer the "should-run" as advertised if it works of course. I'm open to other better solutions.

Nam Gi VU
If you can, download testdriven.net, I can't and thats why I'm stuck with this shitty test environment
Chen Kinnrot
+1  A: 

Might this be the same problem VS2008 seems to have, where if you use run context (Ctrl+R [Ctrl+]T) or run class (Ctrl+R [Ctrl+]C) it acts as if you used run all (Ctrl+R [Ctrl+]A) the first time after opening a solution? Or at least, it seems so to me. In VS2008 I simply stop the test run when I see this happening and restart the same operation. Then it usually works "as advertised".

No idea if and how this might be relevant to VS2010 at all at this stage...

peSHIr