As you may be aware Ayende has recently released Rhino 3.5 Release Candidate. Among many of the great improvements to this release, he as simplified the code needed to mock void methods.
Lets take a look at the older syntax:
Expect.Call(delegate { mockSession.Login("", ""); }).IgnoreArguments().Repeat.Once();
Lets now take a look at the new syntax:
mockSession.Expect( x => x.Login( "", "" ) ).IgnoreArguments().Repeat.Once();
Both ways will accomplish the same goal, but I know that I always hated having to use a delegate to set expectations on a void method. To me the new syntax (using Lambda's) is much cleaner and flows off my keyboard much easier.
+1 for all Ayende's hard work
Till next time,
[----- Remember to check out DimeCasts.Net -----]