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:
- A specific test (ie. a test written by a method marked [TestMethod()])
- All tests in a class
- All impacted tests of the current TFS pending change of mine.
- All tests
- All tests except the ones marked as category [TestCategory("some-category")]
I'm not sure how can I write a correct command for my needs above.
If you know know, please share! All helps are welcomed and very much appriciated!
References:
- the MSTest.exe http://msdn.microsoft.com/en-us/library/ms182487.aspx
- the MSTest.exe's detailed options http://msdn.microsoft.com/en-us/library/ms182489.aspx
- obtaining the result http://msdn.microsoft.com/en-us/library/ms182488.aspx
[Edit]
After a while, I found the below useful tips.
- run Visual Studio unit tests by using MSTest.exe, located at
%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe
in my case. - using
/container:Path\To\Your\TestProjectAssembly.dll
to indicate where your tests are coded. - using
/test:TestFilter
to filter the tests to run. Note that this filter is applied to the full test method name (ie. FullNamespace.Classname.MethodName)
Hope this helps you guys.