配置 NUnit 命令行以运行 MonoTouch 测试
我的 MonoTouch 项目中有一个单元测试,但无法从 MonoDevelop 内部运行 - 它因“Unix 传输错误”而失败。在网上查了一下,这似乎与 NUnit 测试运行程序崩溃有关,所以我想我应该尝试使用命令行测试运行程序。
我使用 MonoDevelop 的“Create Package”来构建和打包所有 DLL,然后尝试使用 nunit-console FooTest.dll
运行我的测试。这会爆炸,但我很确定它与 MonoDevelop 内部爆炸的原因不同。我收到的错误消息是:
** (/Library/Frameworks/Mono.framework/Versions/2.6.7/lib/mono/1.0/nunit-
console.exe:11174): WARNING **: The class System.Action`1 could not be loaded,
used in mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
File or assembly name FooTest, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null, or one of its dependencies, was not found.
我对这里的所有内容都很陌生——NUnit、MonoTouch、MonoDevelop 和.NET——但看起来我需要以某种方式配置 NUnit 以使用 MonoTouch 运行时环境。是这样吗?如果是这样,我该怎么做?
I've got a unit test in my MonoTouch project that I can't run from inside MonoDevelop -- it fails with "Unix transport error." Poking around on the web it looks like that's associated with the NUnit test runner blowing up, so I thought I'd try using the command-line test runner.
I used MonoDevelop's "Create Package" to build and package up all the DLLs, and then tried running my tests with nunit-console FooTest.dll
. This blows up, but I'm pretty sure it's not for the same reason it blows up inside MonoDevelop. The error message I get is:
** (/Library/Frameworks/Mono.framework/Versions/2.6.7/lib/mono/1.0/nunit-
console.exe:11174): WARNING **: The class System.Action`1 could not be loaded,
used in mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
File or assembly name FooTest, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null, or one of its dependencies, was not found.
I'm new to everything here -- NUnit, MonoTouch, MonoDevelop and .NET -- but it looks like I need to somehow configure NUnit to use the MonoTouch runtime environment. Is that it? And if so, how do I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有将 NUnit 与 MonoTouch 结合使用的好方法。
抱歉,我自己也有同样的痛苦。如果有解决方案出现,我会回复。
There isn't a good way to use NUnit with MonoTouch.
Sorry, I have felt the same pain myself. I will post back if a solution ever surfaces.
将 $MONO_PATH 设置为 nunit 库以便能够运行 nunit-console。在我的机器上, $MONO_PATH 声明是(在我的 .profile 文件中):
MONO_PATH='/Applications/Beta/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/:$MONO_PATH'
set $MONO_PATH to the nunit library to be able to run nunit-console. On my machine, the $MONO_PATH declaration is (in my .profile file):
MONO_PATH='/Applications/Beta/MonoDevelop.app/Contents/MacOS/lib/monodevelop/AddIns/NUnit/:$MONO_PATH'