views:

57

answers:

3

My company is trying to decide if we are going to standardize on Moq, Rhino Mocks or MS Moles and Stubs.

I know Rhino Mocks and Moles and Stubs fairly well. But I am unfamiliar with Moq. How does the syntax work? Does it support Arrange Act Assert (AAA) like Rhino Mocks (I hear they created it, but I am not sure). Does it have strong typing?

Basically, I am leaning towards Rhino Mocks (using Moles where needed). But I don't want to do that just because I am familiar with Rhino Mocks. If Moq is in fact better or (even more important) easier to use, then I want to learn it and pick that one.

So, any one out there that has used both and feels like giving me a syntax comparison?

+2  A: 

Have you looked at http://code.google.com/p/moq/wiki/QuickStart ?

Moq supports AAA and strong typing (via use of lambdas)

marcind
+3  A: 

I've done a multi-part blog series on the differences between a number of mocking frameworks. Feel free to check it out at http://www.richard-banks.org/2010/07/mocking-comparison-part-1-basics.html

Richard Banks
Dang good stuff in those posts. Thanks for pointing me that way! Is NSubstitute "Prod" worthy? I am liking the syntax, but as a new arrival to the party, I don't know how stable it is.
Vaccano
I haven't found any real problems with it for production usage. There's a few edge cases that still need smoothing out, but that will come with time, and in those cases you can always fall back to one of the other mock frameworks.
Richard Banks
+1 for the clear write up. (Although the casual use of a finalizer in your example Tourist class raised my eyebrows - IMO you should never use a finalizer unless your class directly contains unmanaged resources.)
Wim Coenen
A: 

This project compares many mock framework against each other: mocking frameworks compare

Peli