单步执行 ASP.NET MVC in Action (2009) - 并陷入 nunit 问题
我似乎错过了一些东西 - 在这一步中,它讨论了下载 nunit 并将原始 MSTest 引用更改为 NUnit。这看起来很好,直到它谈到使用 JetBrains 的 UnitRun 运行测试。
我本以为我可以运行 nUnit 来运行测试 - 但我在 nUnit gui 中加载我的项目,并得到“此程序集不是使用任何已知的测试框架构建的”。这是运行 Nunit-2.5.3.9346.msi 后的结果。或者我应该能够在 Visual Studio 2008 中运行测试吗?
经过一番研究后我发现: http://www.jetbrains.com/unitrun/
(即,它似乎是在说这个不再受支持,我认为 JetBrains Resharper 可能要花钱?)。我对 NUnit 的体验有点生疏。那么我该如何继续进行测试呢?我收到的错误消息是否被视为异常?
我已在 MvcApplication.Tests 项目中添加了对 nunit.framework 的引用。这是添加错误的参考吗?
谢谢 :)
I seem to have missed something - in this step through it talks through downloading nunit and changing the original MSTest reference to NUnit. Which seems fine until it talks about running the test with UnitRun from JetBrains.
I would have thought I could run nUnit to be able to run the test - but I load my project in the nUnit gui and I get "This assembly was not built with any known testing framework". This after running the Nunit-2.5.3.9346.msi. Or am I supposed to be able to run tests from within visual studio 2008?
After some research I find this:
http://www.jetbrains.com/unitrun/
(ie. it seems to be saying this is no longer supported and I'm thinking JetBrains Resharper may cost money?). I'm a little rusty on my NUnit experience. So how do I go ahead and run my test? Is the error message I'm getting considered abnormal?
I've added a reference in my MvcApplication.Tests project to the nunit.framework. Is this the wrong reference to add?
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加对 NUnit 的引用很好,但您需要确保放在类和测试方法上的属性是 NUnit 的属性,而不是 MSTest 的属性。我猜这就是正在发生的事情,并解释了为什么 NUnit GUI 找不到它所期望的属性。
是的,Resharper 需要花钱(但非常值得,恕我直言)
Adding the reference to NUnit is fine, but you need to make sure that the attributes you put on the class and test methods are those of NUnit and not MSTest. I guess this is what is happening and explains why the NUnit GUI does not find the attribute it is expecting.
Yes, Resharper costs money (but is well worth it, IMHO)
在项目中添加对 NUnit.Framework 的引用,然后使用 Testdriven.Net 执行/测试您的测试。
Add a reference to NUnit.Framework in your project, then use Testdriven.Net to execute/test your tests.