var foo = MockRepository.GenerateStub<IFoo>();
foo.Stub(f => f.MyMethod(null)).IgnoreArguments().Return(null).WhenCalled(o
=> o.ReturnValue = o.Arguments[0]);

Notice that you have to use the Return() method to set up a return
value even though it's going to be overwritten via the WhenCalled.
Since the method has a return type defined, Rhino.Mocks requires a
"Return" clause.

---
Patrick Steele
http://weblogs.asp.net/psteele



On Sun, Oct 30, 2011 at 8:42 AM, hagai cohen <[email protected]> wrote:
> hi
>
> I have a the following method: string MyMethod(string input);
> I would like to stub MyMethod that it will return the input parameter.
> For example: for "ABC" the stub method will return "ABC"
>
> how do I do that?
>
> --
> 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