mspec 有 nunit 还是没有 nunit 更好?
我在一些博客和讨论中看到 mspec 与 nunit 一起使用。事实上,我在网上看到的大多数示例都展示了具有某种 nunit 依赖性或集成的 mspec。我的团队正在尝试在新的 ASP.NET MVC2 项目上使用没有 nunit 的 mspec。我们还没有进入规范编写阶段,所以我无法判断哪个更好。您对此有什么经验?将 mspec 与 nunit 一起使用有什么好处吗?没有?
I've seen mspec used with nunit on some blogs and discussions. In fact, most of the examples on the web that I've seen demonstrate mspec with some kind of nunit dependancy or integration. My team is attempting to use mspec without nunit on a new ASP.NET MVC2 project. We're not at the spec-writing stage yet, so I can't tell what is better. What it your experience with this? Are there benefits to using mspec with nunit? Without?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MSpec 不以任何方式依赖于 NUnit 或 xUnit。因此,您可以单独使用 MSpec,因为它有自己的运行器和断言方法。您看到的博客文章很可能使用依赖于 NUnit 或 xUnit 的“旧”断言库。这种依赖关系已于 2009 年底被删除。
您可以做的是一起使用 NUnit 的断言库(
Assert.IsTrue
等),尽管这既不是必需的,我也没有看到这样做有任何好处。与 MSpec。MSpec does not depend in any way on NUnit or xUnit. As such you can use MSpec on its own, as it has it's own runners and assertion methods. The blog posts you saw very likely used the "old" assertion library that were dependent on either NUnit or xUnit. This dependency has been removed in late 2009.
What you can do, although it's neither required nor do I see any benefit in doing it, is to use NUnit's assertion library (
Assert.IsTrue
et al.) together with MSpec.既然您还没有开始,请看一下 SpecFlow,它与 MSTest 和 Visual Studio 很好地集成......
since you not have started yet, take a look at SpecFlow, it integrates nicely with MSTest and Visual Studio....