NUnit 和 Visual Studio 2008 集成测试可以并行使用吗?

发布于 2024-08-22 05:52:16 字数 86 浏览 3 评论 0原文

我有兴趣改进我的测试方法,但不确定我是否更喜欢 NUnit 还是 VS 2008 测试。我还有一本在示例中使用 NUnit 的书。这两个框架能够很好地共存吗?

I am interested in improving my testing methodologies but am not sure if I prefer NUnit or VS 2008 test. I also have a book that uses NUnit in it's examples. Do the two frameworks coexist well with each other?

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

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

发布评论

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

评论(3

半透明的墙 2024-08-29 05:52:16

您通常会选择一个或另一个测试框架,而不是使用两个。尽管事实上,正如 Sergey 提到的,NUnit 和 MSTest 框架非常相似,您可以小心地编写可与这两个框架一起使用的通用测试。然而,存在一些细微的差异,因此请注意并遵循最低的共同点!

如果您想运行为多个框架编写的一套测试,请查看 Gallio,它支持这个场景。

You would normally choose one or the other test framework rather than working with two. Although in fact, as Sergey mentions, NUnit and MSTest frameworks are similar enough that you can, with care, write common tests that can work with both frameworks. There are some subtle differences, however, so watch out and stick to the lowest common denominator!

If you want to run a suite of tests that are written for several frameworks, take a look at Gallio which supports this scenario.

抹茶夏天i‖ 2024-08-29 05:52:16

如果您在不同的类中使用不同的框架,绝对没有问题,它们可以毫无问题地共存(然后项目引用 VisualStudio 测试库和 NUnit.Framework)。您还可以使用像 Sergey 发布的那样的 hack,使它们在同一个类上共存,但请注意,这有一些限制,您将无法使用两个框架的高级功能并以这种方式映射它们(例如 TestCase 属性)对于 NUnit 2.5 等)。

If you use different frameworks in different classes, there is absolutely no problem, the can coexist without trouble (the project then references both VisualStudio test libraries and NUnit.Framework). You can also use hacks like the one Sergey posted to make them coexist on a same class but be aware that this has some limitation and you won't be able to use advanced functionalities of both frameworks and map them in this way (e.g. TestCase attribute for NUnit 2.5 etc.).

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