Planning Rhino Mock 3.5 - The Lambda Edition
Note, this is a copy of the discussion that is taking place in the Rhino Mocks mailing list.
Now that I pushed all the current changes out, we need to start thinking about the next version. I am planning on seeing what kind of syntax I can get from the language using C# 3.0. As of yet, I don't have any concrete ideas about what should be done, so I am here to solicit ideas about what you want.
Syntax suggestions, patches, comments, etc are all welcome.
Comments
I guess the most obvious one is argument or return validation, taking a Func<T,bool>.
If you wanted to be able to log the constraint being violated (and you're in the .NET 3.5 world) you could take an Expression<Func<T,bool>>, compile it to actually run it, and log the ToString() form in case of a violation.
I'm sure there'll be more stuff though - next time I'm doing any reasonably complicated mocking I'll see what I can find :)
(Another option might be to use it to respond to methods, if you needed more behaviour than just returning a constant value.)
Contrats on 3.4 release.
I'd love to see easier support for event handlers. Something like what I described on my blog here: http://kozmic.pl/archive/2008/02/15/testing-callbacks-with-rhino.mocks.aspx
I agree with Krzysztof, better support for events would be great.
Comment preview