[英]Running UWP unit tests in VS 2017
For some reason Visual Studio 2017 does not recognize unit tests in Universal Windows Unit Test App projects. 由于某些原因,Visual Studio 2017无法识别通用Windows单元测试应用程序项目中的单元测试。
Steps to reproduce: 重现步骤:
Assert.IsTrue(true);
Assert.IsTrue(true);
to the unit test created Expected: unit test discovered and run successfully. 预期:发现单元测试并成功运行。
Actual: no tests found. 实际:未找到测试。
Output Tests produces absolutely no output. 输出测试绝对不会产生任何输出。
Comment if there is a log file containing some more info and I'll add it. 评论是否有包含更多信息的日志文件,我将其添加。
EDIT: So it turns out they don't work in 2015 either . 编辑:因此,事实证明他们也不会在2015年工作 。 I have ReSharper in 2015 which is able to run them.
我在2015年ReSharper的,它能够运行它们。 But why can't the VS runner run them?
但是为什么VS跑步者不能运行它们?
By sheer dumb luck (or just desperation), I went to my Test project and Deployed it (right click on project-> Deploy). 由于运气愚蠢(或者只是绝望),我去了我的Test项目并部署了它(右键单击project-> Deploy)。 That made the tests appear and now they run.
这使得测试出现,现在它们可以运行。
This now works in Visual Studio 2017 (version 15.4.5 currently). 现在可以在Visual Studio 2017中使用(当前版本15.4.5)。
After building the solution, the tests appear right away. 构建解决方案后,将立即显示测试。 Deploying the test project may have also worked in the older versions.
在旧版本中,部署测试项目也可能有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.