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: 6,026 | Comments: 44,842

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.


No future posts left, oh my!


  1. Technical observations from my wife (3):
    13 Nov 2015 - Production issues
  2. Production postmortem (13):
    13 Nov 2015 - The case of the “it is slow on that machine (only)”
  3. Speaking (5):
    09 Nov 2015 - Community talk in Kiev, Ukraine–What does it take to be a good developer
  4. Find the bug (5):
    11 Sep 2015 - The concurrent memory buster
  5. Buffer allocation strategies (3):
    09 Sep 2015 - Bad usage patterns
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats