you can add a .Return(null) and the WhenCalled will override this Return and
satisfy the error check.

On 16 May 2011 14:09, Giulio Petrucci <[email protected]> wrote:

> Hi Gavin,
>
> first of all, thank you for your reply.
>
> On Mon, May 16, 2011 at 2:50 PM, Gavin van der Merwe
> <[email protected]> wrote:
> > Try this
> >             var fooService = MockRepository.GenerateStub<IFooService>();
> >             fooService.Stub(s =>
> > s.GetDescription(Arg<Foo>.Is.Anything)).WhenCalled(
> >                 (i) => i.ReturnValue = i.Arguments.First());
> >             var testMe = new TestMe(fooService);
>
> At a glance, I'd say that in this way no return value is provided.
> I've tested this suggestion and I have an error telling me
> "Method 'IFooService.GetDescription(anything);' requires a return
> value or an exception to throw." Any hint?
>
> Thanks again,
> Giulio
>
> --
>
> --
> You received this message because you are subscribed to the Google Groups
> "Rhino.Mocks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rhinomocks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.

Reply via email to