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: 10 | Comments: 37

filter by tags archive

Rhino Mocks 3.4 Released

time to read 2 min | 371 words

Well, it is about that time again, I got enough changes to make a release worthwhile. It has been almost five months, and we got a whole bunch of stuff going on, including a lot of stuff from contributors. (Take that, one man project :-) ).

As usual, you can get it here and the source is available here.

It is interesting to note that a lot of people have stuck with Rhino Mocks 3.1, I guess that there is really no need to upgrade, if you get what you want...

Features, more features, glorious features!

  • Added CreateMockWithRemoting and DynamicMockWithRemoting to work around BCL bug when overriding a generic method with generic constraint.
    This is useful when you want to force Rhino Mocks to use Remoting proxies (usually it just guess and you don't deal with this). That is needed because at certain cases ( generic methods with generic constraints ) there is a bug in Reflection Emit that generate invalid code.
  • Mike Nichols  has added List.ContainsAll() constraint
  • Shawn Neal added the DoNotExpect syntax, which is clearer the Expect.Call().Repeat.Never(), it is certainly shorter.
  • Added trace writer with stack trace, should make it easier to track down strange mocking behavior. Now you can just enable logging and see all the method calls that are being made.
  • Guido van Loon supplied the Property.AllPropertiesMatch constraints
  • Making sure that recorders that wrap recorders will be merged if they contain only one element. Again, this is something that you are not supposed to understand unless you went deep into the code. Suffice to say that the behavior is easier to understand now.

Bugs, annoying bugs, stupid bugs!

  • Fixing issue with empty recorders nested in recorders that has expectations. If you don't get that, then rest assure, neither do I.
  • Demid Sukhovsky  fixed Rhino Mocks support for Out/Ref values using remoting proxies.
  • Fixing null reference exception when stubbing a class with protected setter.
  • Aaron Jensen fixed the validation message when you expect a method that accept a mock object as a parameter.
  • Aaron Jensen also fixed a bunch of my typos.
  • Steven Rockarts fixed a bunch more of my typos.
  • Fixed an issue with methods returning non primitive value types, such as UInt32

Comments

Pawel Pabich

Could you ship the pdb file as well ?

D. P. Bullington

Indeed; see:

http://blog.softwareishardwork.com/2008/02/debug-vs-release-flavor-and-debug.html

This on is on the house... :)

tobsen

Too bad that the nasty intellisense bug was not yet fixed by Microsoft, which still results in broken intellisense support in any Rhino.Mocks version > 3.2 (described in the comments here: http://www.ayende.com/Blog/archive/2007/10/27/Using-Expect.Call-void-method.aspx ) :-( Maybe somebody more skillfull tahn me can have a look at this issue. I would be glad to see a workaround in Rhino.Mocks for this specific issue.

Anyways, thanks for your new release Ayende!

tobsen

Too bad that the nasty intellisense bug was not yet fixed by Microsoft, which still results in broken intellisense support in any Rhino.Mocks version > 3.2 (described in the comments here: http://www.ayende.com/Blog/archive/2007/10/27/Using-Expect.Call-void-method.aspx ) :-( Maybe somebody more skillfull tahn me can have a look at this issue. I would be glad to see a workaround in Rhino.Mocks for this specific issue.

Anyways, thanks for your new release Ayende!

cool-beans

I suspect that one or two people haven't upgraded because 3.3 has the following bug which stops me from mocking wcf services the way i'd like to - it works in 3.1 so i'm sticking with it for now but i'd like to upgrade if you could fix it..

Test method TestMethod1 threw exception: System.InvalidOperationException: The service class of type IServiceClassInterface1Proxy365c436aedac4078959c816454c8e953 both defines a ServiceContract and inherits a ServiceContract from type TIServiceClassInterface1. Contract inheritance can only be used among interface types. If a class is marked with ServiceContractAttribute, it must be the only type in the hierarchy with ServiceContractAttribute. Consider moving the ServiceContractAttribute on type IServiceClassInterface1 to a separate interface that type IServiceClassInterface1 implements..

Thanks

Ayende Rahien

cool-beans,

Can you supply a failing test case?

Kirill Osenkov

Hi all,

this is Kirill Osenkov from the Visual Studio C# IDE team at Microsoft. I'd be happy to help you investigate that IntelliSense bug you've mentioned. For a start, I'd need some repro steps - does it repro in a simple Console Application in Visual Studio 2008? Feel free to contact me with any questions.

Thanks for your help,

Kirill

Ayende Rahien

I don't have a vanilla install of VS 2008, and I couldn't repro the issue.

Nevertheless, here is the code that should probably expose it.

Remove the Return() from both methods and see what you get in intellisense

class Program

{

static void Main(string[] args)

{

    Expect(ReturnString()).Return("");

    Expect(delegate { ReturnString(); } ).Return(1);

}


public static string ReturnString()

{

    return "";

}


public static IFoo<T> Expect<T>(T ignored)

{

    return null;        

}


public static IFoo<object> Expect(Action ignored)

{

    return null;

}

}

public interface IFoo

{

void Return(T obj);

}

Kirill Osenkov

Thanks Ayende. I couldn't repro the bug on Visual Studio 2008, so it looks like we've fixed it since 2005. If you do encounter the bug in Visual Studio 2008, please let me know, I'll be happy to investigate.

Thanks,

Kirill

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

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

And 4 more posts are pending...

There are posts all the way to Sep 10, 2015

RECENT SERIES

  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

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats