Moq (or possibly another framework) on Mono / MonoTouch

后端 未结 1 1557
無奈伤痛
無奈伤痛 2021-02-09 03:10

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,

相关标签:
1条回答
  • 2021-02-09 03:38

    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:

    • System, Version=2.0.0
    • nunit.core, Version=2.4.8
    • nunit.framework, Version=2.4.8
    • [code under test]
    • System.Core, Version=3.5.0
    • Moq.dll

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

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

    (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!)

    0 讨论(0)
提交回复
热议问题