13

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 3

17

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.

Sign up to request clarification or add additional context in comments.

Comments

2

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

thanks.I'll have a look at them later. for now on, I'm just gonna stick with Moq.
@Attilah: Your question sounded like you wanted a MS Solution..Moq is really nice. Hope it meets your needs
1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.