我已經添加期望像這樣的方法,的Android EasyMock的,如何添加一個更多的期待,無需重新設置模擬
expect(locationManager.isLocationSettingsEnabled(anyObject(FragmentActivity.class))).andReturn(isLocationEnabled).anyTimes();
replay(locationManager);
但是,當我加入,重播後,多了一個方法(下面提到的)預期,第一種方法會自動重置。
expect(locationManager.isNotificationSettingsEnabled(anyObject(FragmentActivity.class))).andReturn(isNotificationsEnabled).anyTimes();
我想知道如何在不重置的情況下添加一個期望值。
我想你應該使用[谷歌模擬](http://stackoverflow.com/questions/5743236/google-mock-multiple-expectations-on-same-function-with-different-parameters)或[mockito]( http://stackoverflow.com/questions/8088179/using-mockito-with-multiple-calls-to-the-same-method-with-the-same-arguments)。 –