I have 5 calls to a particular method and I wanted to return different things for each of those 5 calls. I wanted some way in Rhino Mocks to say
For the 1st call return this
For the 2nd call return that
and so on
Is this possible?
I have 5 calls to a particular method and I wanted to return different things for each of those 5 calls. I wanted some way in Rhino Mocks to say
For the 1st call return this
For the 2nd call return that
and so on
Is this possible?
Just use Repeat.Once()
after each method stub. For example:
myMock.Stub(x => x.Method()).Return(1).Repeat.Once()
myMock.Stub(x => x.Method()).Return(2).Repeat.Once()