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: 5,972 | Comments: 44,519

filter by tags archive

Rhino Mocks 3.5 Beta Released

3 Months ago I released Rhino Mocks 3.4, we have made some great improvement to Rhino Mocks in the meantime, and it is time for a new release. I generally don't believe in beta releases for Rhino Mocks, but this time we are coming up with a new syntax, and I want to get additional external input before we make a final release on that.

The biggest new feature is the new AAA syntax, which you can read about in the relevant post, but we had a few other new things as well.

  • CreateMock() is deprecated and marked with the [Obsolete] attribute. Use StrictMock() instead.
  • Better handling of exception in raising events from mock objects
  • Fixing an issue with mock objects that expose methods with output parameter of type System.IntPtr.
  • Allowing to return to record mode without losing expectations, thanks to Jordan Terrel, for submitting this patch.

I intend to write a lot more documentation about the new AAA syntax, but for now, you can visit the tests for the feature, to see how it works.

As usual, you can find the bits here.

Note that this release if for .Net 3.5 only. Rhino Mocks 3.5 RTM will be for .Net 2.0 and 3.5, but I am focusing on the capabilities that I can get from the 3.5 platform at the moment.


Ivaylo Bratoev

This syntaxis is really cool. The AAA model seems more natural than the record-replay. I have one issue with it - how assert that a method on a stub with 0 parameters was called only once?

Ayende Rahien


Right now, I don't think you can.

Please post this to the list.

Ivaylo Bratoev

Thanks for the fast response.

Do I guess properly that I cannot set up return values on readonly properties of a stub?

And, Ayende, what list do you refer to?

Ayende Rahien

You can setup return values for stubs, yes.

Same way you use it elsewhere.

Rhino Mocks mailing list on google groups

Ivaylo Bratoev

Actually, I wrote that I cannot set up values on read only properties of a stub. I used this code:

var person = MockRepository.GenerateStub();

person.Stub(x => x.IsGeek).Return(true);

What confused me was that person.IsGeek property returns true only the first time. I have to add ...Repeat.Any() to make it work properly.

I think that for STUBS the default behavior should be ...Repeat.Any() not Repeat.Once(). What do you think of that?

I posted both issues on the mailing list.

Comment preview

Comments have been closed on this topic.


  1. Reducing parsing costs in RavenDB - 12 hours from now

There are posts all the way to Aug 04, 2015


  1. Production postmortem (5):
    29 Jul 2015 - The evil licensing code
  2. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
  3. API Design (7):
    20 Jul 2015 - We’ll let the users sort it out
  4. What is new in RavenDB 3.5 (3):
    15 Jul 2015 - Exploring data in the dark
  5. The RavenDB Comic Strip (3):
    28 May 2015 - Part III – High availability & sleeping soundly
View all series


Main feed Feed Stats
Comments feed   Comments Feed Stats