I'm trying to write something like this:
myStub.Stub(_ => _.Create(Arg<Invoice>.It.Anything)).Callback(i => { i.Id = 100; return i; });
I want to get actual object that passed to mock, modify it and return back.
Is this scenario possible with Rhino Mocks?
Best Answer
You could use the
WhenCalled
method like this:and then you can create your stub as such: