简体   繁体   English

Visual Studio调试单一测试

[英]Visual Studio Debug Single Test

I use to be able to right-click in one of my test classes and select Debug Test which would run the single test. 我曾经能够右键单击我的一个测试类,然后选择“调试测试”来运行单个测试。 All of a sudden it says Debug Test(s) when I right-click and runs all my tests. 当我右键单击并运行我的所有测试时,突然间说调试测试。

How can I debug just one test? 如何调试仅一项测试?

Thanks 谢谢

Microsoft Visual Studio Community 2017 Microsoft Visual Studio社区2017

You can right click directly on your [TestMethod] and select "Run test(s)"/"Debug test(s)", or open the Test Explorer window (from the menu: Test -> Windows -> Test Explorer) and run test method from there (selecting a group or a single one). 您可以右键单击[TestMethod]然后选择“运行测试” /“调试测试”,或打开“ 测试资源管理器”窗口(从菜单中:“测试”->“ Windows”->“测试资源管理器”)并运行从那里测试方法(选择一组或单个)。

PS: remember to put at least one breakpoint inside the test you want to debug. PS:请记住在要调试的测试中至少放置一个断点。

Not sure why but I had to reinstall the NuGet Test packages and that seemed to fix it. 不知道为什么,但是我不得不重新安装NuGet Test软件包,这似乎可以解决它。 Thanks Manuel for the help. 感谢Manuel的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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