在Mono/MonoTouch上的最小起订量(或其他框架) [英] Moq (or possibly another framework) on Mono / MonoTouch

查看:75
本文介绍了在Mono/MonoTouch上的最小起订量(或其他框架)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始进行一些MonoTouch开发,但我尝试使Moq进行单元测试工作,但以失败告终.二进制版本失败了,因为它正在寻找System v2.0,我认为这取决于其Castle要求,并且从源代码构建它会使编译器崩溃!

I've just started some MonoTouch development and I've tried, and failed, to get Moq working for my unit tests. The binary version fails because it's looking for System v2.0, which I assume is down to its Castle requirements, and building it from source crashes the compiler!

我的问题是,有没有人让Moq从事Mono的工作(触摸部分应该无关紧要,我没有将其部署到手机上!),或者对其他任何模拟框架感到高兴吗?无法返回自己的状态,这有点痛苦.

My question is has anyone gotten Moq to work on Mono (the touch part should be irrelevant, I'm not deploying it to the phone!), or had any joy with any of the other mocking frameworks? Failing that I'm back to rolling my own, which is a bit of a pain.

推荐答案

我现在正在与Monodevelop一起使用Moq来测试Monotouch应用程序的非Monotouch部分,但我没有遇到任何麻烦.对于目标运行时,我的测试项目和受测试的代码均使用Mono/.NET 3.5,并且对于引用,它具有:

I'm using Moq right now with Monodevelop to test the non-Monotouch parts of a Monotouch app, and I haven't had any trouble. For the target runtime, my test project and the code under test both use Mono / .NET 3.5, and for references, it's got:

  • 系统,版本= 2.0.0
  • nunit.core,版本= 2.4.8
  • nunit.framework,版本= 2.4.8
  • [正在测试的代码]
  • System.Core,版本= 3.5.0
  • Moq.dll

系统,nunit.core和nunit.framework均由Monodevelop提供.

System, nunit.core and nunit.framework are all as provided by Monodevelop.

我正在使用的Moq是Moq.4.0.10827/NET35/Moq.dll.

The Moq I'm using is Moq.4.0.10827/NET35/Moq.dll.

(我没有运气NUnit来测试Monotouch部件-我想是因为运行测试时没有手机或模拟器,因此Monotouch包装的本机代码无法运行.分离出应用程序的非iOS特定部分,并设置两个单独的解决方案,一个用于实际构建,一个用于对可以进行单元测试的部分进行单元测试. )

(I haven't had any luck NUnit-testing the Monotouch parts -- I assume because when the tests are running, there's no phone or simulator, so the native code Monotouch is wrapping can't run. I've had to separate out the non-iOS-specific parts of the app and set up two separate solutions, one for real builds and one for unit testing the parts that can be unit tested. If you've gotten farther than that, let me know!)

这篇关于在Mono/MonoTouch上的最小起订量(或其他框架)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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