Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 151243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:25:07+00:00 2026-05-11T09:25:07+00:00

There are lots of mocking frameworks out there for .Net. There is no clear

  • 0

There are lots of mocking frameworks out there for .Net. There is no clear winner that has superseded the others in every way. The leading mocking frameworks also have many different styles of usage.

The time it takes to learn all of the mocking frameworks well enough to decide which to use is unreasonable. I don’t believe that we have yet reached a stage that we can talk about the best mocking framework. So what questions should I be asking, both about the project, and about myself, to help decide on the best mocking framework to use, in a given case?

It would also be useful to know why you chose the mocking framework you are currently using and if you are still happy with that choice.

Is there a useful vocabulary to use when comparing the styles of mocking frameworks?

(Note: I have limited this question to .Net as Java does not have attributes or lambda expression, so I hope the mocking frameworks can be better for .Net then Java)

Summary so far:

  • If you need to mock static method, or none virtual methods then the only reasonable option is TypeMock, however it is not free and does not drive you towards a good design.
  • Rhino Mocks is a very good option if you are doing TDD, .e.g the objects you wish to mock implement interfaces. At present it seems to be the ‘market leader’
  • Moq (introduction) should be considered if you are using .NET 3.5 Moq may be gaining on Rhino Mocks for new projects

What have I missed from this summary?

So what drives the choice between Rhino Mocks and Moq, if you are using .NET 3.5?


see also:

  • What C# mocking framework to use?
  • What are the capabilities of Moq and Rhino.mocks?
  • What are the real-world pros and cons of each of the major mocking frameworks?

“What should I consider when choosing a dependency injection framework for .NET?” may also be of interest as it asks the “other side” of the question.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:25:08+00:00Added an answer on May 11, 2026 at 9:25 am

    So what questions should I by asking about the project and myself to help decide on the best mocking framework to use in a given case?

    The questions you should be asking about the project is: Has the project been developed with the SOLID principles, or not? Is this a project that has loose coupling and high cohesion? Have good OO principles been utilized in building the project? Is a Dependency Injection container being utilized? Has the system been coded in a Design by Contract method (utilizing Interfaces thoroughly)?

    If you answer yes to these questions, then you can utilize a mocking framework like RhinoMocks, which is what some would call an ‘opinionated’ framework. RhinoMocks, and some other mocking frameworks, have very strong opinions about how a system should be designed in order for objects to be mocked. A framework like RhinoMocks expects your project to be designed a certain way. Mocking is certainly a lot easier with RhinoMocks when you’ve built your code the right way (no sealed classes, no statics, heavy use of interfaces, virtual on class methods, etc.)

    If you answer no to those questions, or if you’re working on a legacy system with a lot of highly coupled classes, then your only choice is going to be TypeMock, which can mock just about anything.

    It would also be useful to know why you choose the mocking framework you are currently using and if you are still happy with that choose.

    I chose RhinoMocks because at the time (3+ years ago) it was clearly the most mature mocking framework with the most features. I’ve stayed with it because it has evolved in away that makes my life much easier (the advent of the AutoMocking container being a gigantic step toward efficiency).

    What I like about RhinoMocks, other than the feature set and ease of use, is that it guides me toward a better design in my code. I am not a perfect programmer, and I am going to make mistakes in design. But tools like RhinoMocks and NHibernate help guide me toward a better design, because when I do make mistakes and create poor design, these tools become painful to work with. NHibernate, for instance, is painful to work with if you have a bad database design. RhinoMocks is very painful to work with if you have a poor class design, aren’t using interfaces, aren’t using IoC… etc.

    I like RhinoMocks because it ultimately helps me be a better developer, and not just because I’m testing my code, but because I’m shaping my code – designing it – in a better manner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's lots of good material on Design Patterns out there that covers how you
There are lots of Fluent implementations out there now that work with Lambdas to
There are lots of web application frameworks available these days, for pretty much every
there are lots of questions out there related to shared preferences and the alternatives.
There are lots of times Eclipse can't connect to emulator that I turned on
I know that there are lots of posts about memory leaks. Now i am
There are lots of examples out there about how to open and use a
There are lots of posts out there on pivoting rows into columns for various
There's lots of recommendations out there about handling dates. I'd just like to clarify
There are lots of version control systems out there. Git, Mercurial, SVN, TFS... But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.