Reputation: 71
Having read good things about Moles I'd like to add an isolation framework to our set of tools for writing unit tests.
Our application runs under Mono as it is deployed on both Linux and Windows and I cannot seem to find a framework that supports Mono.
I've seen some articles about manipulating assemblies using Cecil but I'm struggling to find anything we could realistically use.
Upvotes: 5
Views: 629
Reputation: 33108
TypeMock is most likely your only choice when adding in your comments on the answer from @IanNorton .
Upvotes: 0
Reputation: 7282
Looks like Moles works using the JIT, so I'd expect it to be very very tied to microsoft's implementation.
I've had a fantastic amount of success using Moq on mono, With a very small amount of effort it is possible to create a proxy instance of almost any class and intercept nearly all method calls. The latest binary version of Moq works very well on mono for me.
using Moq;
var mock = new Mock<MyClass> { CallBase = true };
mock.Setup( x => x.MyMethod() ).Returns ( 1 );
After using Moq to setup things I generally prefer to use NUnit but you can use any other test framework.
Upvotes: 4