@Test public void CheckClientMultipleAddsOneUndoRedoTest() { CreateClientAction action = new CreateClientAction(baseClient, manager); invoker.execute(action); Client second = new Client("SecondClient", null, "Last", LocalDate.of(1970, 1, 1), 2); CreateClientAction secondAction = new CreateClientAction(second, manager); invoker.execute(secondAction); invoker.undo(); assertEquals(baseClient, manager.getClients().get(0)); assertEquals(1, manager.getClients().size()); invoker.redo(); assertEquals(baseClient, manager.getClients().get(0)); assertEquals(second, manager.getClients().get(1)); assertEquals(2, manager.getClients().size()); }
@Override protected void execute() { super.execute(); manager.addClient(client); }
CreateClientAction extends ClientAction { @Override protected void execute() { super.execute(); manager.addClient(client); } }
CreateClientAction extends ClientAction { @Override protected void execute() { super.execute(); manager.addClient(client); } CreateClientAction(Client client, ClientManager manager); }
CreateClientAction extends ClientAction { @Override protected void execute() { super.execute(); manager.addClient(client); } CreateClientAction(Client client, ClientManager manager); @Override String getExecuteText(); @Override String getUnexecuteText(); }
CreateClientAction extends ClientAction { @Override protected void execute() { super.execute(); manager.addClient(client); } CreateClientAction(Client client, ClientManager manager); @Override String getExecuteText(); @Override String getUnexecuteText();  }