简体   繁体   中英

running a c# test project through an exe file

I have a bunch of c# tests that I want to run through a powershell script. I am currently doing this by creating a windows application project, writing the tests as a part of a general class and compiling it into .exe and running the exe but its not the right way to go.

How can I, say, create a class (that can come out as .exe) that can run all tests in a given project or some other way that I can easily run all tests through a powershell script, which is used for application deployment

Try to use MSTest.exe . There are lots of parameters

Example from the link above.

mstest /testcontainer:Errors.dll /detail:testtype

or ( VS90COMNTOOLS change to your version)

"%VS90COMNTOOLS%\..\IDE\MSTest.exe"/testcontainer:Errors.dll /detail:testtype

or (change 'Microsoft Visual Studio 11.0' to your VS folder)

"%PROGRAMFILES%\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe"  /testcontainer:Errors.dll /resultsfile:out

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM