Run all open tests in Visual Studio
Asked Answered
P

3

8

Is there an easy way to run all tests in open test classes in Visual Studio. I find that this is what I most often need to do.

Mostly I use Resharpers or TestDriven.NET testrunners, and I cant find any easy way to do that in either testrunner. In Resharper it would be nice to have a "Add all open tests to session" feature, but after much googling I cant find one, or any other easy way to do this.

Is there a tool, plugin, or what-not to do this?

Pyrostat answered 2/7, 2010 at 7:55 Comment(2)
If you suggest this in their bugtracker (youtrack.jetbrains.net), I'll vote for it. This would be pretty useful.Franko
GOod idea, ill see what I can do.Pyrostat
O
11

AFAIK, there isn't such a feature.

Alternatively you could

  • run all tests within a class (by setting the cursor to the class, outside of a method, and pressing Ctrl+R T)
  • run all tests within a namespace (by setting the cursor into the namespace, outside of a class, and pressing Ctrl+R T)

After you managed to run the interesting tests (however), you could

  • run these tests again by pressing Ctrl+R D
  • run failed tests again by pressing Ctrl+R F

Then you can create test lists. I don't do this, it's to time consuming to keep them up to date.

Olodort answered 2/7, 2010 at 7:58 Comment(2)
You can also click the three-circles icon next to the test class, and "Append to session", and only run them once you've added all the tests you want. That way you're not waiting for all the tests to run every time you add another test class to the session. But agreed, I don't know of any way to automatically build a session from all tests in currently-open files.Franko
Yes, basically thats what I do today. At some point you have so many test classes it becomes tedious. Also, if I close my solution for the day, to reopen it the next day, all my code is opened, test classes and all, but the test session is not preserved..Pyrostat
P
1

Run ALL tests: Press Ctrl + R, A

Pontonier answered 16/11, 2015 at 14:4 Comment(0)
G
0

Have you considered automating your tests to be run on a build server under something like CruiseControl?

Gablet answered 10/7, 2010 at 4:2 Comment(2)
Whether you have a continuous integration server or not, you still need to run the tests frequently as you code. CI is just a safety net -- it doesn't remove the need to run tests yourself.Franko
Yes we run cruisecontrol.net. But ofcourse I still need to run the tests as often as possible while I work.Pyrostat

© 2022 - 2024 — McMap. All rights reserved.