是否可以拥有 MSpec 和 MSpec? NUnit 在单个项目中进行测试?
我有一个使用 NUnit 的单元测试项目。当我将 mspec (machine.specations) 程序集添加到引用中时,ReSharper 和 TestDriven.Net 都停止运行 NUnit 测试,而仅运行 mspec 测试。
有没有一种方法或设置可以同时允许 NUnit 和 NUnit mspec 测试使用 R# & 共存并在同一项目中运行TD.Net 测试运行者?
I've got a unit test project using NUnit. When I add the mspec (machine.specifications) assembly to the references, both ReSharper and TestDriven.Net stop running the NUnit tests and only run the mspec tests.
Is there a way or setting that allows both NUnit & mspec tests to co-exist and run in the same project using R# & TD.Net test runners?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚在 VS 2008 上使用 ReSharper 5.0 和 TestDriven.Net 3.0 RC2 以及以下代码对此进行了测试。
我无法用 ReSharper 重现您所描述的行为。首先,ReSharper 检测两个测试类,如绿色和黄色装订线标记所示。右键单击该项目并选择“运行单元测试”即可成功运行这两个测试。通过装订线图标单独运行它们也可以按预期工作。
至于TestDriven.Net,我不确定它是否支持在一个项目中使用多个测试框架的场景。当我在项目上“运行测试”时,仅执行 MSpec 上下文。但是,在 NUnit TestFixture 内部单击时“运行测试”会执行 NUnit 测试。
I've just tested this on VS 2008 with ReSharper 5.0 and TestDriven.Net 3.0 RC2 and the following code.
I cannot reproduce the behavior you describe with the ReSharper. First off, ReSharper detects both test classes as indicated by the green-and-yellow gutter marks. Right-clicking on the project and selecting "Run Unit Tests" runs both tests successfully. Running them individually via the gutter icons also works as expected.
As for TestDriven.Net, I'm not sure whether it supports scenarios where multiple test frameworks are used within one project. When I "Run Test(s)" on the project, only the MSpec context is executed. However, "Run Test(s)" while clicking inside the NUnit TestFixture executes the NUnit test.
确保在 ReSharper 中打开 MSpec。即使您“安装”了运行器(手动或通过 bat 文件),默认情况下它也不会打开。将其打开于
Make sure you turn on MSpec in ReSharper. Even if you "installed" the runner (by hand or by bat file), it's not turned on by default. Turn it on at