@Test public void register() { undoneCommandsRegistrySpy.register(abstractScenarioGridCommandMock); assertFalse(undoneCommandsRegistrySpy.isEmpty()); scenarioCommandRegistryManagerSpy.register(scenarioSimulationContextLocal, abstractScenarioGridCommandMock); verify(doneCommandsRegistrySpy, times(1)).register(eq(abstractScenarioGridCommandMock)); verify(undoneCommandsRegistrySpy, times(1)).clear(); verify(scenarioCommandRegistryManagerSpy, times(1)).setUndoRedoButtonStatus(eq(scenarioSimulationContextLocal)); assertTrue(undoneCommandsRegistrySpy.isEmpty()); }
public void register(ScenarioSimulationContext context, AbstractScenarioGridCommand command) { doneCommandsRegistry.register(command); undoneCommandsRegistry.clear(); setUndoRedoButtonStatus(context); }
ScenarioCommandRegistryManager extends AbstractCommandRegistryManager<AbstractScenarioGridCommand> { public void register(ScenarioSimulationContext context, AbstractScenarioGridCommand command) { doneCommandsRegistry.register(command); undoneCommandsRegistry.clear(); setUndoRedoButtonStatus(context); } }
ScenarioCommandRegistryManager extends AbstractCommandRegistryManager<AbstractScenarioGridCommand> { public void register(ScenarioSimulationContext context, AbstractScenarioGridCommand command) { doneCommandsRegistry.register(command); undoneCommandsRegistry.clear(); setUndoRedoButtonStatus(context); }  }
ScenarioCommandRegistryManager extends AbstractCommandRegistryManager<AbstractScenarioGridCommand> { public void register(ScenarioSimulationContext context, AbstractScenarioGridCommand command) { doneCommandsRegistry.register(command); undoneCommandsRegistry.clear(); setUndoRedoButtonStatus(context); }  void register(ScenarioSimulationContext context, AbstractScenarioGridCommand command); CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext scenarioSimulationContext); CommandResult<ScenarioSimulationViolation> redo(ScenarioSimulationContext scenarioSimulationContext); }
ScenarioCommandRegistryManager extends AbstractCommandRegistryManager<AbstractScenarioGridCommand> { public void register(ScenarioSimulationContext context, AbstractScenarioGridCommand command) { doneCommandsRegistry.register(command); undoneCommandsRegistry.clear(); setUndoRedoButtonStatus(context); }  void register(ScenarioSimulationContext context, AbstractScenarioGridCommand command); CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext scenarioSimulationContext); CommandResult<ScenarioSimulationViolation> redo(ScenarioSimulationContext scenarioSimulationContext);  }