在 Visual Studio 中运行所有开放测试

发布于 2024-09-07 13:42:50 字数 258 浏览 4 评论 0原文

有没有一种简单的方法可以在 Visual Studio 中的开放测试类中运行所有测试。我发现这是我最常需要做的事情。

我大多数情况下使用 Resharpers 或 TestDriven.NET 测试运行程序,但我无法在这两个测试运行程序中找到任何简单的方法来做到这一点。在 Resharper 中,如果有一个“将所有开放测试添加到会话”功能就好了,但经过多次谷歌搜索后,我找不到一个功能,也找不到任何其他简单的方法来做到这一点。

有没有工具、插件或者什么不能做到这一点?

Is there an easy way to run all tests in open test classes in Visual Studio. I find that this is what I most often need to do.

Mostly I use Resharpers or TestDriven.NET testrunners, and I cant find any easy way to do that in either testrunner. In Resharper it would be nice to have a "Add all open tests to session" feature, but after much googling I cant find one, or any other easy way to do this.

Is there a tool, plugin, or what-not to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

¢好甜 2024-09-14 13:42:50

AFAIK,没有这样的功能。

或者,您可以

  • 在类内运行所有测试(通过将光标设置到方法外部的类,然后按Ctrl+RT
  • 运行在类内的所有测试命名空间(通过将光标设置到类外部的命名空间中,然后按Ctrl+R T

在成功运行有趣的测试后(但是),您可以

  • 运行Ctrl+R D再次运行这些测试
  • Ctrl+R F再次运行失败的测试

然后您可以创建测试列表。我不这样做,让它们保持最新状态太耗时了。

AFAIK, there isn't such a feature.

Alternatively you could

  • run all tests within a class (by setting the cursor to the class, outside of a method, and pressing Ctrl+R T)
  • run all tests within a namespace (by setting the cursor into the namespace, outside of a class, and pressing Ctrl+R T)

After you managed to run the interesting tests (however), you could

  • run these tests again by pressing Ctrl+R D
  • run failed tests again by pressing Ctrl+R F

Then you can create test lists. I don't do this, it's to time consuming to keep them up to date.

背叛残局 2024-09-14 13:42:50

运行所有测试:按 Ctrl + R、A

Run ALL tests: Press Ctrl + R, A

巾帼英雄 2024-09-14 13:42:50

您是否考虑过在诸如 CruiseControl 之类的构建服务器上自动运行测试?

Have you considered automating your tests to be run on a build server under something like CruiseControl?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文