Visual Studio 单元测试“开始调试"开始所有测试 [英] Visual studio unit testing "Start Debugging" starts all tests

查看:34
本文介绍了Visual Studio 单元测试“开始调试"开始所有测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用调试"菜单中的开始调试"时,Visual Studio 单元测试将启动所有测试,而不是仅在测试列表编辑器或测试结果窗口中选择的测试.这真的很烦人,因为我不仅在测试时使用快捷方式启动项目,而且我多次自动按下该键,VS 启动所有测试,而不是我目前正在调试的一两个测试.

Visual studio unit testing starts all tests when I use "Start Debugging" from Debug menu, instead just ones selected in Test List editor or Test results window. It's really annoying since I use shortcut to start projects not only while testing, and number of times I just hit that key automatically and VS starts all tests instead just one or two that I am currently debugging.

这可以更改为仅在测试列表编辑器中运行选定的测试吗?

Can this be changed to just run selected tests in Test List Editor ?

更新:我知道测试菜单下的启动命令,但问题是该快捷方式在我的大脑中是硬编码"的,我每天在调试 winforms 和 ASP.NET 项目时以及在单元测试中使用它多次如果它开始所有测试

UPDATE : I am aware of start commands under Test menu, but problem is that that shortcut is "hardcoded" in my brain and I use it every day number of times while debugging winforms and ASP.NET projects, and in unit test case it starts all tests

推荐答案

在工具->选项下,转到环境->键盘屏幕,然后按[F5]选择要运行的任务.单击按快捷键:"框(或按 [Alt]+P),然后按 [F5].您会看到它告诉您 [F5] 当前由 Debug.Start 使用.单击分配"按钮(或按 [Alt]+S)将 [F5] 更改为您想要的值.要恢复原始功能,请重复上述过程,但将 Debug.Start 作为您要为其分配快捷键的项目.(或者,如果您不想保留任何其他内容,请单击重置"按钮.)

Under Tools->Options, go to the Environment->Keyboard screen, then select the task you want to run when you press [F5]. Click in the "Press shortcut keys:" box (or press [Alt]+P), and then press [F5]. You'll see that it tells you that [F5] is currently used by Debug.Start. Click on the Assign button (or press [Alt]+S) to change [F5] to be what you want it to be. To restore the original functionality, repeat the above process but with Debug.Start as the item you're assigning the shortcut key to. (Or click on the Reset button if there's nothing else you want to preserve.)

这篇关于Visual Studio 单元测试“开始调试"开始所有测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆