views:

2027

answers:

5

I cannot find a specific feature-by-feature comparison of Moq and Rhino. All the questions are "which do you like better and why", or "here's how you do a simple mock in rhino and how it's done in moq".

I cannot find a deep comparison anywhere. I'm aware of the syntax differences, I'm not looking for answers about that. I am looking for a capability comparison. For example:

  • Rhino has Expect.On() for threaded mocking. Can Moq do this?

  • What about Multi-mocking (implementing multiple interfaces with one mock). Can Moq do this?

  • I believe Moq can now mock Protected members. Can Rhino do this?

Edit: I ended up looking at some of the other .Net frameworks as well.

+1  A: 

I'm not an expert by any means, but I believe the Rhino added some of the Moq syntax so that the learning curve has been reduced to what you'd expect with MoQ. I worked with both with testing and some of the syntax was almost identical. I was initially going to go with MoQ as it was easier, but then my bud showed me the latest updates and how similar they were. Just letting ya know.

rball
I actually find that this is one of the things that makes Rhino harder. Almost all the documentation is for the older syntaxes, so you end up mixing them up when looking at the examples, leading to all kinds of weird errors :/
womp
Agreed.It seems like they've tried to do certain things multiple ways without removing the "old" way of doing it. I suppose it's for compatibility. I honestly have a lot better understanding of MoQ just because it doesn't try to diff a Mock or a Fake and no funky syntax. MoQ's pretty nice with that
rball
+1  A: 

Rhino has GetArgumentsForCallsMadeOn() which IMO makes it easier to verify arguments in some cases.

+2  A: 
  • Check here for the moq features
  • Check here for the Rhino Mocks features
Rodrigo Guerreiro
+38  A: 
womp
I updated the chart slightly. There may be a couple revisions to it over the next little while, I have some other additional line items that might be added.
womp
+1 nice chart, makes a good summary
zombat
A: 

I might add "Behavior Verification" into these. That seems to be Moq's biggest limitation, which Rhino (not sure about others) has no problem with.

What is limited about behaviour verification in Moq? I haven't run into any limitations yet. It has Verify() and VerifyAll(), and you can set any Setup() call to be Verifiable regardless of return value.
womp