I googled and found the below helpful references. Currently I want to run all from the command-line (for easy of execution & quickness) in cases:
I'm not sure how can I write a correct command for my needs above.
References:
After a while, I found the below useful tips.
%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe
in my case./testcontainer:Path\To\Your\TestProjectAssembly.dll
to indicate where your tests are coded. You can specify multiple '/testcontainer' options if required./test:TestFilter
to filter the tests to run. Note that this filter is applied to the full test method name (ie. FullNamespace.Classname.MethodName)The command to run the tests is python -m unittest filename.py . In our case, the command to run the tests is python -m unittest test_utils.py .
Currently I can have some answers for my needs:
A specific test (ie. a test written by a method marked [TestMethod()]
)
Use MSTest.exe
/container:
TheAssemblyContainingYourSpecificTest /test:
TheSpecificTestName
All tests in a class
Use MSTest.exe
/container:
TheAssemblyContainingYourClass /test:
TheClassNameWithFullNamespace
Note that the /test:
is the filter which uses the full name of the class when filtering.
The others are still left unknown. Please disscuss if you know how.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With