How to run a single test case from MSTEST
I am using MStest to run a single test case but could not find a correct command
I tried:
1)mstest.exe /testcontainer:testproject.dll /test:MethodTest1 This run all the test case starting from name MethodTest1. I have other test name Like MethodTest100, MethodTest101
2)mstest.exe /testcontainer:testproject.dll /test:MethodTest1 /unique This needs to pass Test Namespace name and Test Class name.
It works when i execute following but i have only access to Te开发者_如何学编程st Method not to class or namepsace mstest.exe /testcontainer:testproject.dll /test:TestNamespace.TestClass MethodTest1 /unique
I would appreciate if somebody could help me in exact command to run a single test case without using Class Name or Name pace in which TestMethod Lies.
Thanks
For running multiple tests under a given class or namespace, you can use a wild card *.
So, running:
mstest.exe /testcontainer:testproject.dll /test:TestNamespace.TestClass.*
will work
A test case name only needs to be unique within the context of a test class, and a test class name only needs to be unique in the context of a test namespace. Therefore, when you want to run a single test (by name) you always have to also supply the names of the containing namespace and class. Otherwise, MSTest is not able to uniquely identify the test you want to have run.
精彩评论