Hi,

this is default C# behavior handling closures.

Just change your loop to store a local copy of the variable x and the test 
will run.

      for (int x = 0; x < 1000; x += 100)
      {
        int x1 = x;
        call.Expect(c => c.Call(Arg<int>.Matches(p => p == x1)));
      }


As far as I can see there is no bug in RhinoMocks.
But if anyone might want to further improve the API for this kind of 
constraints - contributions to 
https://github.com/hibernating-rhinos/rhino-mocks/network or any other more 
advanced branch are always welcome.

Best regards,

Andreas

Am Samstag, 5. Oktober 2013 13:57:35 UTC+2 schrieb Phil Atkin:
>
> Sorry - which two methods on what class?  Are you saying that the 
> behaviour of my examples would be different if the bug were fixed? 
>
> On 05/10/2013 09:13, Alexander Fedin wrote: 
> > It fails because of the bug in the Rhino Mocks code: the code tries to 
> compile the expression by calling LambdaExpression.Compile method through 
> the reflection and does not take in account that there are two methods with 
> the same name on that class. Somebody should fix this annoying thing. 
> > 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rhinomocks.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to