Benjamin
Benjamin

Reputation: 3826

Unit Test failed when using Visual Studio Command Prompt

I have class library project which reads word document files. and I have created 30 unit cases scenarios for it. When I run the unit test using visual studio IDE it runs perfectly and all the test cases get "Success", However when I use Visual Studio Command Prompt and test it, some of the test cases get failed. I would appreciate if you guys can provide me some hint in this regard. To test my solution in Command Prompts I type: "MSTest /testcontainer:mysolutiontest.dll"

Upvotes: 1

Views: 867

Answers (1)

John Koerner
John Koerner

Reputation: 38079

If you are running VS2012 or later, use vstest.console.exe:

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\ide\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" PathToYour.dll /logger:trx

You'll also probably want to use a .runsettings file to specify the TargetPlatform and ResultsDirectory, which would then use a command line like this:

"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\ide\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" PathToYour.dll /logger:trx /settings:PathToYour.runsettings

Upvotes: 3

Related Questions