How do I run .cs tests that I normally run in the Visual Studio Test Explorer, in the command line?

1.9k Views Asked by At

While I'm developing, I often have to run about 5-6 tests to populate the data I need for tests. I want to automate this so I don't have to right-click/"Run" every time.

How can I get the command that VS is running so that I can just put it into a quick script that runs all the tests I need to run, in a single click (or single command) ?

Visual Studio Test Explorer

2

There are 2 best solutions below

2
On BEST ANSWER

The mstest.exe command line tool is what you are looking for.

Here on stack overflow, you find it under the [mstest] tag, for example how to run an mstest dll from command line

0
On