EasyMock驗證行為
EasyMock提供了一個檢查被使用或不使用verify()方法,請看下麵的代碼片段。
//activate the mock EasyMock.replay(calcService); //test the add functionality Assert.assertEquals(mathApplication.add(10.0, 20.0),30.0,0); //verify call to calcService is made or not EasyMock.verify(calcService);