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

查看:16
本文介绍了配置 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 测试运行器
  • 您可以使用在 Mac 上使用 Mono 运行的 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天全站免登陆