TestDriven.Net 仅运行文件中的一个测试装置

发布于 2024-07-26 06:28:02 字数 520 浏览 2 评论 0原文

我正在使用 NUnit(但也尝试过使用 VS 测试),但在让 TestDriven.Net 识别并运行单个 .cs 文件中的不同测试装置时遇到问题。

我正在尝试做一些 BDD 风格的测试。 所以我在一个文件中的内容是这样的:

[TestFixture]
public class when_view_is_ready : AAA
{
  // setup, tests
}

[TestFixture]
public class when_something_happens : AAA
{
   // setup, tests
}

当我在 NUnit GUI 运行器中运行它时,它会很好地看到不同的测试装置并运行所有测试。 当我通过 TestDriven.NET 上下文菜单运行它并观察输出窗口时,它只运行第一个装置的测试。 是否有一个原因? 这可以解决吗?

我想我正在运行 TestDriven.Net 2.0。 我不能确定; 不太确定如何检查我的版本。

感谢任何帮助!

I'm using NUnit (but have also tried this with VS testing) and I'm having a problem getting TestDriven.Net to recognize and run different test fixtures in a single .cs file.

I'm trying to do a little BDD style testing. So what I have in one file is something like this:

[TestFixture]
public class when_view_is_ready : AAA
{
  // setup, tests
}

[TestFixture]
public class when_something_happens : AAA
{
   // setup, tests
}

When I run this in the NUnit GUI runner it sees the different test fixtures just fine and runs all the tests. When I run it via TestDriven.NET context menu and watch the Output window, it only runs the first fixture's tests. Is there a reason for this? Can this be fixed?

I think I'm running TestDriven.Net 2.0. I can't be certain; not exactly sure how to check my version.

Appreciate any help!

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

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

发布评论

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

评论(1

一梦等七年七年为一梦 2024-08-02 06:28:02

您可以在帮助->查看TestDriven的版本 关于在 Visual Studio 中,或在工具 -> 中 插件管理器。

我可以确认这是 3.0.2556 中的问题,当运行测试时,当您右键单击该文件并选择“运行测试”时,它仅运行文件中的第一个 TestFixture。 当您右键单击包含的目录或项目并“运行测试”时,它将运行两个装置。

当使用其他测试运行程序(例如 Resharper 的测试运行程序)时,即使在文件上运行它也会运行两个固定装置。

最好的办法可能是使用 TestDriven.net 报告错误

You can check the version of TestDriven in Help -> About in Visual Studio, or in Tools -> Addin Manager.

I can confirm that this is an issue in 3.0.2556, when running tests it runs only the first TestFixture in the file, when you right-click the file, and select "Run Tests". When you right-click on the containing directory or project, and "Run Tests", it runs both fixtures.

When using other test runners, like Resharper's testrunner, even running it on the file runs both fixtures.

Best thing to do, is probably to report a bug with TestDriven.net

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