配置NUnit命令行以运行MonoTouch测试 [英] Configuring the NUnit command line to run MonoTouch tests

查看:63
本文介绍了配置NUnit命令行以运行MonoTouch测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MonoTouch项目中有一个不能从MonoDevelop内部运行的单元测试-它因"Unix传输错误"而失败.在网络上浏览时,这似乎与NUnit测试运行程序爆炸有关,所以我想我应该尝试使用命令行测试运行程序.

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.

我使用MonoDevelop的创建程序包"来构建和打包所有DLL,然后尝试使用nunit-console FooTest.dll运行测试.这会炸毁,但我很确定不是因为它在MonoDevelop中炸毁的原因相同.我收到的错误消息是:

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.

我对这里的所有内容都是新手-NUnit,MonoTouch,MonoDevelop和.NET-但看来我需要以某种方式配置NUnit以使用MonoTouch运行时环境.是吗如果是这样,我该怎么做?

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?

推荐答案

将NUnit与MonoTouch结合使用并不是一种好方法.

There isn't a good way to use NUnit with MonoTouch.

  • 当前没有可在iPhone或模拟器中运行的NUnit测试运行程序
  • 您可以在具有Mono的Mac上运行的NUnit上测试MonoTouch dll,但不能使用这些程序集中的任何iOS库.这意味着您不能测试您的控制器,只能测试没有UIKit内容的后端模型逻辑.

对不起,我自己也感到同样的痛苦.如果解决方案浮出水面,我会回发.

Sorry, I have felt the same pain myself. I will post back if a solution ever surfaces.

这篇关于配置NUnit命令行以运行MonoTouch测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆