Ayende @ Rahien

My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:


+972 52-548-6969

, @ Q c

Posts: 10 | Comments: 37

filter by tags archive

Rhino Mocks 3.0 Released!

time to read 4 min | 782 words

I gave it a few weeks outside, and quite a few people downloaded and tried it, so I am feeling good about it. I had a surprised that kept me from release the 3.0 for a while, but I'll talk about it later.

The binaries and code are in their usual place, here.

(Image from clipboard).png


  • Moved all the constraints to Rhino.Mocks.Constraints namespace. This was done to avoid conflicts with NUnit and MbUnit's new assert syntax.

New features:

  • Generic Methods (at last!)
  • Support arrays of value types as out parameters
  • Support non-CLS Compliant value types such as UInt64
  • Better error messages when using generic delegate methods on generic types
  • Generally faster
  • Using Dynamic Proxy 2 - better performance, better code-base, full support for weird generic scenarios.
  • Text.* constraints can now be used to evaluate non strings as well, by calling the ToString() method. Useful for things such as the Criteria API in NHibernate.


  • The CallOriginalMethod() was deprecated, you are now encouraged to use CallOriginalMethod(OriginalMethodOptions.NoExpectation) or CallOriginalMethod(OriginalMethodOptions.CreateExpectation) instead. The reasoning behind the change is that currently CallOriginalMethod looks like it create an expectation, but it doesn't really does it,  it is better to be explicit about the whole thing.
  • The build script will internalize almost everything no related to Rhino Mocks (Except AbstractInvocation) - prevent conflicts from users that uses both Dynamic Proxy and Rhino Mocks - i.e, me).

Bug fixes (from previous 3.0 Beta):

  • Fixed regression with closed generic types inheriting from open generic types that contains generic properties of the generic type, if the property is overriden
  • Fixed issues with the generic method return values.
  • Regression with closed generic types inheriting from open generic types that contains generic properties of the generic type, if the property is overriden
  • Fixed a problem with the new semantics of CallOriginalMethod
  • Fixed a problem mocking internal types that are not nested
  • Fixed a misleading exception when you pass a mock object of type that override ToString() to an unexpected method.
  • Fixing another issue with AbstractExpectation not checking the real return type of generic methods.
  • Fixed issue with generic method call on generic type for interfaces
  • Fixing an issue with BackToRecord no clearing originalMethodsToCall expectations.
  • Improved support for wacky generics scenarios.
  • Better support for types having non inheritable attributes that cannot be easily replicated.
  • Better support for types implementing interfaces by using a base class that is located in another assembly.



Just out of interest why is it called "Rhino" Mocks? Shot.

Ayende Rahien

Why is it called Rhino Mocks?

Take a look at the top of this page, and check the banner.

Basically, I needed a name, and I like Rhinos.


Congrats Ayende! it is a big!

Gian Maria

Great shot Ayende, I can wait to upgrade all my project with this new version :D.

Gian Maria


Ayende anuncia o release da versão 3.0 de seu framework de Mock objects. Para quem não quem ainda sabe

Comment preview

Comments have been closed on this topic.


  1. Production postmortem: The case of the memory eater and high load - about one day from now
  2. Production postmortem: The case of the lying configuration file - 3 days from now
  3. Production postmortem: The industry at large - 4 days from now
  4. The insidious cost of allocations - 5 days from now
  5. Find the bug: The concurrent memory buster - 6 days from now

And 4 more posts are pending...

There are posts all the way to Sep 10, 2015


  1. Find the bug (5):
    20 Apr 2011 - Why do I get a Null Reference Exception?
  2. Production postmortem (10):
    14 Aug 2015 - The case of the man in the middle
  3. What is new in RavenDB 3.5 (7):
    12 Aug 2015 - Monitoring support
  4. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats