NUnit 和 Visual Studio 2008 集成测试可以并行使用吗?
我有兴趣改进我的测试方法,但不确定我是否更喜欢 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,请查看此链接NUnit/MSTest 双重测试
以及加强 Visual Studio 单元测试
yes, check out this links NUnit/MSTest Dual Testing
and Strengthening Visual Studio Unit Tests
您通常会选择一个或另一个测试框架,而不是使用两个。尽管事实上,正如 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.
如果您在不同的类中使用不同的框架,绝对没有问题,它们可以毫无问题地共存(然后项目引用 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.).