How to test void methods using EasyMock

前端 未结 2 1746
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 23:30

I\'ve seen a few questions out there regarding this but I can\'t seem to make sense of any of the answers for my particular problem.

I have a mock object, lets call

2条回答
  •  渐次进展
    2021-01-03 23:50

    object1.toggleDisplay();
    EasyMock.expectLastCall().times(5);
    

    or if you import statically the EasyMock methods:

    import static org.easymock.EasyMock.*;
    
    [...]
    
    object1.toggleDisplay();
    expectLastCall().times(5);
    

提交回复
热议问题