Rhino Mocks

Rhino Mocks 4.0.0 Alpha Released

It has been a little longer than expected but the latest version of Rhino Mocks has been released and is available from NuGet. You can download the package from here:


This is an “alpha” release since there are more than likely going to be a few things that come up. As a matter of fact, there are two things that I am already thinking about changing.

One is to be a little more explicit with arranging expectations against properties. Right now when you arrange an expectation against a property the intent is inferred. Instead I think it would be better to be explicit by adding ExpectPropertyGet and ExpectPropertySet.

The other is more of an internal modification to help track expectations easier. Currently an expectation is stored in a single data structure which includes the method, arguments, constraints and return values. When a method is intercepted all of the expectations have to be checked to find a match (clearly there are short circuits but… you get the idea). This modification will help account for how many times a method has (or hasn’t) be called and increase performance.

Until then, however, enjoy this alpha version and feel free to provide feedback.


4 thoughts on “Rhino Mocks 4.0.0 Alpha Released

  1. Igor says:

    Hello Mike,
    I have an unpleasant problem with concurrency in 3.6.1

    I wonder if it’s still supported and if you can do something with that. Trying to locate source at the moment.

    Thanks in advance,
    PS. It might be the wrong post to place this comment

  2. Mike,

    First of all, big thank you for taking over this awesome mocking framework. I’m a reasonably experienced developer, but never had a chance to get my hands dirty with unit testing done right. Since I had the opportunity to do so at work now, I’m starting to use Rhino and finding it much better than any other mocking framework that I have ever seen.

    As you point out, it has some unnecessary complexities and I also find great that you are having the guts to expose and fix them. Kudos!

    Now back to “my own problem”… One thing I find really hard to do when I am creating tests on top of Rhino is that it’s very hard to debug the tests. The error messages returned by Rhino are really hard to understand and act upon (ok, I’m using 3.5 because it’s the version available at my job, I’ll try pushing for at least updating to a newer version, probably not an alpha version, though).

    Do you have plans to make those error messages more user friendly? Scenarios that come to my mind are:

    1. I’m writing a new test case and hitting issues with the mocks not getting called in the proper order, or with the wrong parameters, or the wrong number of times, etc. It would be great if in the exception we could get some verbose information stating what’s the full list of expectations (with parameters) and pointers to the expectations that were not met.

    2. The test is running in the test lab on a daily basis and during smoke tests. Now you get a failure in the test logs. How can you figure out what went wrong? A similar scenario is when you make a change to the product code and tests start to fail. My experience is that it is really hard to debug a failing case in order to determine where the problem is.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s