2

I have an issue to automate unit tests. I created a Unit Test Project (with the template for Universal Windows Platform) and I written my test methods. I can execute my tests from the test explorer window by clicking "Execute all" button. But my issue appears when I try to execute my tests with MSTest from command line. The command returns "No test to execute."

Here is the command I use:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\MSTest.exe" /resultsfile:"C:\UnitTests\Results.trx" /testcontainer:C:\UnitTestProject\bin\x86\Release\UnitTestProject.exe /nologo

Thanks

Samuel

Samuel LIOULT
  • 594
  • 5
  • 21

1 Answers1

3

There is a detailed guide to running UWP Unit tests from command line here - Running Universal Windows unit tests from the command line . The problem is that you UWP EXE files cannot be run directly as usual Windows apps, but run in a sandbox, which means you use the APPX package to first deploy and install the test app and then run the actual tests.

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
  • Thank you Martin, this works well for me. But I have an other issue to generate APPX package with command line tool. The MSBuild command works well on my development machine, but in my build server (without VS), it "works" without errors but it produced no output. – Samuel LIOULT Dec 22 '17 at 07:53