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?
A mock object is an object that can act as a real object but can be controlled in test code. Moq is a library that allows us to create mock objects in test code.
Mock OptionsStrict Mock. A strict mock requires you to provide alternate implementations for each method/property that is used on the mock. If any methods/properties are used which you have not provided implementations for, an exception will be thrown. Dynamic Mock.
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
Have you looked at http://code.google.com/p/moq/wiki/QuickStart ?
Moq supports AAA and strong typing (via use of lambdas)
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