History refactor

This commit is contained in:
serso
2016-01-11 17:20:57 +01:00
parent b21d8084f0
commit 3fd671877d
14 changed files with 280 additions and 232 deletions

View File

@@ -62,13 +62,13 @@ public class CalculatorHistoryTest {
addState(calculatorHistory, "2354");
addState(calculatorHistory, "23547");
final List<OldHistoryState> states = calculatorHistory.getStates(false);
final List<OldHistoryState> states = calculatorHistory.getCurrentHistory();
Assert.assertEquals(2, states.size());
Assert.assertEquals("23547", states.get(1).getEditorState().getText());
Assert.assertEquals("123+3", states.get(0).getEditorState().getText());
}
private void addState(@Nonnull CalculatorHistory calculatorHistory, @Nonnull String text) {
calculatorHistory.addState(OldHistoryState.create(EditorState.create(text, 3), DisplayState.empty()));
calculatorHistory.addCurrentState(OldHistoryState.create(EditorState.create(text, 3), DisplayState.empty()));
}
}