I did search the forum and did not find a similar question. I'm looking to make a final decision on our mocking framework of choice moving forward as a best practice - I've decided on Moq... untill I just recently discovered MS has finally created a mocking framework called Moles which seems to work similar to TypeMock via the profiler API sexyness etc..
There's a million 'NMock vs Moq vs TypeMock vs Rhino....' threads on here. But I never see Moles involved.In fact, I did not even know if its existence until a short time ago. Anyone using it? In Production? Anyone dump their old mocking framework for it, and if so, which one? How did it compare to ther mocking frameworks you've used?
thanks.. ps, we are using VS2008 and are moving to 2010 shortly.
I am in the same scenario you are in , so I'd like to comment on my experiences.
Both Typemock and Moles have the goal of isolation in mind. Especially for those pesky sealed classes, non-virtual methods.
I believe an isolation framework, as ones mentioned above, are needed especially if you are in the later phases of development and/or have no/little control of the code base.
These are the advantages in Typemock, I have not yet discovered with Moles
I hope Moles matures into released product, but the beginning of my tinkering with it seems to be no different than other MS Research projects; usually unpolished, but that seems to be the nature of those type of projects.
I think moles are taking mocking to the next level, it's much more powerful.
What do you mean by 'in production'?. Moles are only useful in unit testing. It has a serious performance impact and it also allows unsafe code in production (ever thought about replacing an IsAuthorized function to return true?).
Moles are usable in both 2008 and 2009.
Hope this answers your question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With