Looking for suggestions: what is the best Mocking package for .NET?
I am diving deep into unit testing, mocking, stubbing, IOC, and everything that goes with it. I am looking for some guidance from those who are using these tools 'in the field.' From what I can tell, in order of popularity, the mocking package options are as follows:
Hans Overkamp, Feb 13, 2010
As someone commented, there are other alternative as well. I just released a revision of Simple.Mocking (http://simpledotnet.codeplex.com/) with added support of AAA-style assertion of expected method calls to mocks.
Aug 19, 2010
Have used Rhino and Moq. MOQ is prefered for a C# person
Aug 03, 2010
At my company I'm pushing for MOQ as the standard for .NET Mocking frameworks along with custom mocks.
I've used Rhino.
Typemock is expensive but it is the one to use for legacy older apps that do not utilize interfaces in the application design.
Up need to understand and use dependency injection and IoC techniques with the majority of open source mock frameworks.
Ronald Garlit, Aug 08, 2010
I have only used Rhino Mock and Moq, and found Moq to be easier to understand and use. Moq does require .Net 3.5 though, which might be a deal-breaker for some.
What I am aware of is that TypeMock and JustMock are the only mocking frameworks that can mock non-virtual methods, sealed classes and static methods and classes which isn't supported in most open source/free mocking tools. If anyone know of a free mocking tool that can do this please post a comment about it.
Here is a list of other mock frameworks not mentioned in the original post:
Robert Blixt, Aug 02, 2010
I have used "Rhino" and "Moq" and both seems to be quite good enough for most situations. But due to the fluentness of the API's I tend to move towards "Moq" more frequently now.
TypeMock is great but has a price tag as highlighted.
Rajesh Pillai, Jul 31, 2010