我有5个特定方法的调用,我希望为这5个调用中的每一个返回不同的东西。我想在Rhino Mocks中用某种方式说出
For the 1st call return this
For the 2nd call return that
等等
这可能吗?
答案 0 :(得分:1)
在每个方法存根之后使用Repeat.Once()
。例如:
myMock.Stub(x => x.Method()).Return(1).Repeat.Once()
myMock.Stub(x => x.Method()).Return(2).Repeat.Once()