UWP MSTest不起作用

问题描述 投票:2回答:1

我有一个自动化单元测试的问题。我创建了一个单元测试项目(带有通用Windows平台的模板),我编写了测试方法。我可以通过单击“执行所有”按钮从测试资源管理器窗口执行我的测试。但是当我尝试从命令行使用MSTest执行测试时出现了我的问题。该命令返回“No test to execution”。

这是我使用的命令:

“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

谢谢

塞缪尔

unit-testing command-line uwp mstest
1个回答
3
投票

有一个从命令行运行UWP单元测试的详细指南 - Running Universal Windows unit tests from the command line。问题是您的UWP EXE文件无法像通常的Windows应用程序一样直接运行,而是在沙箱中运行,这意味着您使用APPX软件包首先部署和安装测试应用程序,然后运行实际测试。

© www.soinside.com 2019 - 2024. All rights reserved.