5
考慮以下代碼片段: -「EasyMock.expectLastCall();」在沒有進一步調用IExpectationSetters的情況下做任何事情?
Whatever mock = EasyMock.createMock(Whatever.class);
mock.doSomething();
EasyMock.expectLastCall(); // <- Does this do anything?
EasyMock.replay(whatever);
是否expectLastCall()
這裏實際上做什麼嗎?從我的測試中添加或刪除此行似乎沒有任何區別。
很明顯,如果您將.andThrow
或.atLeastOnce()
等添加到呼叫中,這很有用。這不是我所問的。