I'm new with MSTest (Visual Studio 2010). Is there any integrated mocking framework that comes with VS2010? Or is there any other good mocking framework that's easy to pick up that I could use?
3 Answers
The VS 2010 doesn't come with mocking framework. But you can use either Rhino Mocks (supports .NET 2.0 and 3.5), or Moq (supports .NET 3.5 and .NET 4).
Both frameworks are good, but I prefer Moq, since it feels more natural to me. It uses fluent lambda syntax which feels very clean to me once you get used to it.
Both frameworks are open source.
If you want a commercial one, go with Typemock isolator. This framework can mock virtually anything but not free.
Comments
you may want to take a look at pex and moles. I haven't really played with it but if you want to stay faithful to MS tools, take a stab at it.
2 Comments
Not sure if mocking supported yet by Microsoft. I used rhino mock for type safety option, you can read this just for a warm up.