﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>That is already there.
  
It is ugly and unseemly
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment12</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment12</guid><pubDate>Wed, 09 Jul 2008 06:43:38 GMT</pubDate></item><item><title>Daniel Cazzulino commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>Wouldn't it be even better if Do had generics overloads to receive the argument types directly too?
  
  
Like:
  
  
.Do&lt;int, string&gt;(x =&gt; a);  
  
  
I think that makes the lambda syntax cleaner.
  
It also converges with Moq Callback syntax :)
  
  
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment11</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment11</guid><pubDate>Sat, 05 Jul 2008 18:06:13 GMT</pubDate></item><item><title>Ayende Rahien commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>Do( (Func&lt;int, string&gt;) (x) = &gt; a);
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment10</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment10</guid><pubDate>Thu, 03 Jul 2008 00:39:33 GMT</pubDate></item><item><title>Shawn Neal commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>How would you go about lazily returning a value in an older version of RhinoMocks?  Moq's "Returns" statement takes a value or a delegate (iirc), but RhinoMocks "Return" takes only a value (int in my example).  Is there another way in RhinoMocks to set the return value that I'm not aware of?
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment9</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment9</guid><pubDate>Thu, 03 Jul 2008 00:12:39 GMT</pubDate></item><item><title>Ayende Rahien commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>You could always do that (as far back as 2.0).
  
The problem was the syntax was lousy.
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment8</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment8</guid><pubDate>Wed, 02 Jul 2008 23:55:13 GMT</pubDate></item><item><title>Shawn Neal commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>This is great especially the returnValue you've added to the Do syntax.  I can finally reproduce all of the Moq QuickStart examples using RhinoMocks, the Expect Call With Reference Lazy Evaluate was the last one I was having problems reproducing using RhinoMocks.  This now works:
  
  
[Test]
  
public void ShouldExpectCallWithReferenceLazyEvaluate()
  
{
  
    int a = 25;
  
    var mock = MockRepository.GenerateMock&lt;IFoo&gt;();
  
  
    mock.Expect(x =&gt; x.DoArgument(Arg&lt;string&gt;.Matches(arg =&gt; arg == a.ToString())))
  
        .Return(a)
  
        .Do(invocation =&gt; invocation.ReturnValue = a);
  
  
    a = 10;
  
  
    Assert.AreEqual(10, mock.DoArgument("10"));
  
}
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment7</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment7</guid><pubDate>Wed, 02 Jul 2008 23:51:31 GMT</pubDate></item><item><title>Ayende Rahien commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>Chris.
  
Use MockRepository instance methods instead. Then you can call mocks.VerifyAll();
  
This feature has been in Rhino Mocks since 2.0
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment6</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment6</guid><pubDate>Wed, 02 Jul 2008 18:05:29 GMT</pubDate></item><item><title>Ayende Rahien commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>Eddie ,
  
No, that is a bug.
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment5</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment5</guid><pubDate>Wed, 02 Jul 2008 18:03:16 GMT</pubDate></item><item><title>Ayende Rahien commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>Chris,
  
Wrapped up, I don't want to expose the underlying implementation to the user
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment4</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment4</guid><pubDate>Wed, 02 Jul 2008 18:00:44 GMT</pubDate></item><item><title>Chris Canal commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>I like the new syntax, it almost stopped me moving to Moq, however, is there no way to centralise verifying all the expectations?
  
  
With Moq you get the MockFactory to pull mocks out and allows you to call VerifyAll.  This seems to be missing with Rhino 3.5?  Or am I being stupid?
  
  
I'm not a huge fan of using a callback, it adds noise IMO....
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment3</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment3</guid><pubDate>Wed, 02 Jul 2008 15:18:36 GMT</pubDate></item><item><title>Eddie Garmon commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>Is there any reason that you start with wasCalled as true? Validating it is true at the end is rather pointless given the initial truthfullness.
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment2</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment2</guid><pubDate>Wed, 02 Jul 2008 14:40:48 GMT</pubDate></item><item><title>Chris Ortman commented on Rhino Mocks 3.5: A feature to be proud of - seamless Do()</title><description>What is invocation? IInvocation or is it wrapped up?
  
  
</description><link>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment1</link><guid>http://ayende.com/3397/rhino-mocks-3-5-a-feature-to-be-proud-of-seamless-do#comment1</guid><pubDate>Wed, 02 Jul 2008 12:44:50 GMT</pubDate></item></channel></rss>