Ayende @ Rahien

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

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 18 | Comments: 82

filter by tags archive

Rhino Mocks 3.0: Beta 2 Released

time to read 2 min | 286 words

Took a bit longer than I anticipated, since people found some really hard bugs with regards to the generics support. I now know a lot more than I ever wanted to about generics, and I considered myself an expert before-hand.

Anyway, the new bits have:

  • Improved support for wacky generics scenarios. Thanks to James and Thierry.
  • Better support for types having non inheritable attributes that cannot be easily replicated. Thanks to Aaron.
  • Better support for types implementing interfaces by using a base class that is located in another assembly.* Thanks to Aaron.
  • Included XML Documentation files.
  • All merged assemblies are not marked internal, to save your from collisions if you are using the Castle bits yourself.

Changes:

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, s it is better to be explicit about the whole thing. Thanks for Enrst for pointing it out to me.

As usual, the binaries and source are here.

* If you understood what that meant...


Comments

Andrew

The .zip appears to be corrupt (only ~104 KB?)

David Newman

I'm so glad we've got generics support now, I can get rid of a bunch of classes with this!

Can I make a feature request? Can you add a property to the MockRepository that tells me if it's in record or replay state? I have some testfixtures where the teardown does a VerifyAll, but occasionaly a test will slip in that doesn't make any expectations, so I have to call mocks.ReplayAll() in it otherwise i get an exception in the TearDown

Ayende Rahien

@Andrew,

It should be that small, yes.

If you got a corrupt file, please download again, I just verified that it works.

Ayende Rahien

@David,

There is no such state as Record/Replay for the whole repository, only for a single mock object.

What I tend to do for the TearDown is just put:

mocks.ReplayAll();

mocks.VerifyAll();

ReplayAll will move all those that are in record state to replay mode, which will make Verify happy.

David Newman

Now I feel stupid! Thanks Ayende

Andrew

Thanks Ayende. Download now fine - but get the error:

Access is denied: 'Castle.DynamicProxy.AbstractInvocation'.

Repro with:

public interface ICanMock { void SomeMethod(); }


[TestFixture]

public class CanMockFixture

{

    [Test]

    public void TesCanMock()

    {

        MockRepository repository = new MockRepository();

        ICanMock canMock = repository.CreateMock<ICanMock>();

    }

}
Ayende Rahien

Opps, that was my mistake.

Please try again, it should work now.

Andrew

Great - that's worked. Cheers.

Nick

I tried to download as well and got:


Compressed (zipped) Folders Error


The Compressed (zipped) Folder is invalid or corrupted.


OK


Ayende Rahien

Please try now, and tell me if the problem persists.

JCichocki

I am also having the problem downloading the zip, I also get zip is corrupt.

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

  1. The insidious cost of allocations - 3 hours from now
  2. Buffer allocation strategies: A possible solution - 3 days from now
  3. Buffer allocation strategies: Explaining the solution - 4 days from now
  4. Buffer allocation strategies: Bad usage patterns - 5 days from now
  5. The useless text book algorithms - 6 days from now

And 1 more posts are pending...

There are posts all the way to Sep 11, 2015

RECENT SERIES

  1. Find the bug (5):
    20 Apr 2011 - Why do I get a Null Reference Exception?
  2. Production postmortem (10):
    03 Sep 2015 - The industry at large
  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

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats