当您拥有 Resharper 时,为什么还要使用 TestDriven.net?

发布于 2024-10-18 02:29:09 字数 138 浏览 2 评论 0原文

据我所知,TestDriven.net 专注于提供从 Visual Studio 内直接访问运行测试的权限。然而,Resharper 虽然是一个更通用的工具,但也提供了此功能。如果使用 Resharper,那么使用 TestDriven.net 还有什么意义吗?

As far as I can tell, TestDriven.net is focused on giving direct access to running tests from within Visual Studio. Yet, Resharper, while being a more general tool, provides this functionality as well. If one uses Resharper, is there any point in using TestDriven.net?

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

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

发布评论

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

评论(6

无名指的心愿 2024-10-25 02:29:09

如果您有重新磨刀器,那么不,您可能不需要它。如果您不这样做,它是一个很棒的免费工具。

If you have resharper, then no, you probably don't need it. If you don't, its a great, free tool.

梦里泪两行 2024-10-25 02:29:09

使用 TestDriven.NET,您可以使用“运行测试”执行“任何”方法。我使用执行一些静态方法来测试一些我不确定的东西(例如日期时间格式等),并且一旦解决,就不需要进行单元测试。

如果 ReSharper 也有这个,我还没有找到它,或者是被 TestDriven.NET 蒙蔽了;-)
据我所知,它只能执行[Test]等带注释的函数。

With TestDriven.NET you can execute "any" method with "Run Test(s)". I use that execute some static methods to just test some things I'm unsure of (like DateTime formats, etc.) and that, once settled, don't need to be a unit test.

If ReSharper has that too, I haven't found it yet or was too blinded by TestDriven.NET ;-)
As far as I can tell, it can only execute [Test], etc. annotated functions.

醉生梦死 2024-10-25 02:29:09

对我来说,TestDriven.NET 的优点可归结为三个要点:

  1. 没有图形测试运行器。我真的不喜欢到处都是红色和绿色灯的窗户。 TestDriven.NET 只是在输出控制台中报告“n 通过,m 失败,x 跳过”。这就是您需要看到的全部内容。
  2. 任何 Console.Write() 调用都会显示在输出控制台上。这对于快速峰值非常有用,也是发展单元测试的好方法。我通常首先只写入控制台,然后将输出复制并粘贴回测试中,并对复制的先前输出进行输出断言。如果输出发生变化,则测试失败。
  3. 正如 Christian 所说,能够运行任何方法,而不仅仅是测试方法,是一种出色的生产力工具。这是在 C# 中拥有 REPL 的下一个最佳选择(是的,是的,如果您愿意,请告诉我有关 Mono C# REPL 的所有信息:)。

For me, the advantages of TestDriven.NET come down to three main points:

  1. No graphical test runner. I really don't like windows popping up all over the place with red and green lamps. TestDriven.NET simply reports "n passed, m failed, x skipped" in the output console. That's all you need to see.
  2. Any Console.Write() calls appear on the output console. This is wonderful for quick spikes and a great way of evolving unit tests. I often start out by just writing to the console, then copying and pasting the output back into the test and doing an assert of the output against the copied previous output. If the output changes, the test fails.
  3. As Christian says, being able to run any method, not just test methods, is a fantastic productivity tool. It's the next best thing to having a REPL in C# (yes yes yes tell me all about the Mono C# REPL if you want :).
霓裳挽歌倾城醉 2024-10-25 02:29:09

TestDriven.net 有一项 Resharper 没有的功能:代码覆盖率报告,该报告非常有用。

TestDriven.net has one feature Resharper does not: the code coverage report, which is extremely useful.

原来分手还会想你 2024-10-25 02:29:09

我不喜欢 Resharper 有几个原因,但我想从 VS 运行和调试测试,这就是我喜欢 TestDriven.net 的原因。而且它是免费的。

I don't like Resharper for couple of reasons, but I want to run and debug tests from VS, and that's why I like TestDriven.net. Plus it is free.

萤火眠眠 2024-10-25 02:29:09

我发现 TestDriven.net 比 ReSharper 更适合运行单元测试。 我认为这可能只是因为我经常使用 TestDriven.net,并且只使用 ReSharper 几个星期。

ReSharper 似乎只是运行测试并查看其结果需要更多步骤,据我回忆,ReSharper 显示了一个复杂的 UI,而不仅仅是从单个测试中提供简单的文本输出。

在多次使用 ReSharper 后,我想说它擅长运行大量单元测试,并在超过 1 个测试失败时显示综合结果。我仍然认为 TestDriven.net 非常适合运行单个单元测试,或者当您经常运行测试而只有 1 或 2 个测试失败时。

I found TestDriven.net better then ReSharper for running unit tests. I think this may just be because I have used TestDriven.net a lot and was only using ReSharper for a few weeks.

ReSharper just seems to be a lot more step to run a test and see its results, from what I recalled ReSharper displayed a complex UI rather than just giving simple text output from a single test.

After using ReSharper a lot more, I would say it is good at running lots of unit tests and showing the combined result when more then 1 test fails. I still think TestDriven.net is great for running a single unit test, or when you run test so often that only 1 or 2 tests fail.

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