Are there any mocking frameworks for Mono ??? I'm gender that I can not find it

I'm just looking for the final answer to this: are there any mocking frameworks that work with Mono, like Moq or RhinoMocks ??? Yes, I understand that I can do manual layouts, but I'm talking about something with a good API ... like Moq or RhinoMocks. I work with MonoTouch on purpose, but I am surprised that I could not even find any mocking frameworks for direct Mono.

From what I read, it seems that one of the reasons why there is no fraudulent structure for MonoTouch is that most of them use Reflection.Emit, which, of course, will not pass Apple's static analysis to represent the AppStore.

BUT, what about apps other than the AppStore? Many enterprise applications are distributed outside the AppStore and therefore are not subject to static analysis. And it is very common to see mocking frameworks used in enterprise applications.

So, why don't we see how mocking frameworks are used more often with MonoTouch apps?

+4
source share
2 answers

I found that Simple.Mocking works out of the box with Mono. It's not as simple as some of the other ridicule, but it works!

+2
source

Well, I found that the Moq Source from GitHub MAY be compiled for Mono. But you also need Castle.Core .

However, you are trying to build Castle.Core with Mono 2.10.x (2.10.11 at the time of this writing), you will get a compilation error (CS0314) about general type restrictions in PriorityBehaviorExtensions.cs. This is an error on lines 2.10.x Mono.

To build Castle.Core, I had to build with Mono 3.0.10. Once you satisfy this dependency, you can use Castle.Core to create Moq.

I still need to do some testing to make sure everything is in order. I just wanted it all to be recorded before I go out the door. Hope this helps someone.

Thanks to Moku (Daniil Kazzulino) for pointing me in the right direction.

EDIT: This does NOT work for me. I managed to create the DLLs just fine, but they aimed at the wrong structure. The problem is that I cannot create the Castle.Core library oriented to MonoTouch, because some .NET functions that Castle.Core uses are simply not available in Mono. SO, unable to build Castle.Core for MonoTouch, I also cannot create Moq or even RhinoMocks for MonoTouch.

+3
source

All Articles