@Test public void testDelete() throws Exception { model.delete(client1); assertEquals(1, events.size()); assertTrue(events.get(0) instanceof ClientDeletedEvent); assertEquals(client1, ((ClientDeletedEvent) events.get(0)).getClient()); events.clear(); assertEquals(1, clientManager.clients.size()); assertFalse(clientManager.clients.contains(client1)); model.delete(client1); assertEquals(0, events.size()); }
public void delete(Client client) { if (clientManager.delete(client)) { if (client.equals(selectedClient)) { selectClient(null); } bus.publish(new ClientDeletedEvent(client)); } }
ClientModel { public void delete(Client client) { if (clientManager.delete(client)) { if (client.equals(selectedClient)) { selectClient(null); } bus.publish(new ClientDeletedEvent(client)); } } }
ClientModel { public void delete(Client client) { if (clientManager.delete(client)) { if (client.equals(selectedClient)) { selectClient(null); } bus.publish(new ClientDeletedEvent(client)); } } ClientModel(ClientManager clientManager, TaskManager taskManager); }
ClientModel { public void delete(Client client) { if (clientManager.delete(client)) { if (client.equals(selectedClient)) { selectClient(null); } bus.publish(new ClientDeletedEvent(client)); } } ClientModel(ClientManager clientManager, TaskManager taskManager); void subscribe(Object listener); void unsubscribe(Object listener); Client getSelectedClient(); void selectClient(Client newClient); Client create(); int count(); Client get(int index); int indexOf(Client client); void save(Client client); void delete(Client client); int getTotalSecondsElapsed(Client client); String getTotalTimeElapsed(Client client); BigDecimal getTotalAmountEarned(Client client); String getTotalAmountEarned(Client client, Locale locale); }
ClientModel { public void delete(Client client) { if (clientManager.delete(client)) { if (client.equals(selectedClient)) { selectClient(null); } bus.publish(new ClientDeletedEvent(client)); } } ClientModel(ClientManager clientManager, TaskManager taskManager); void subscribe(Object listener); void unsubscribe(Object listener); Client getSelectedClient(); void selectClient(Client newClient); Client create(); int count(); Client get(int index); int indexOf(Client client); void save(Client client); void delete(Client client); int getTotalSecondsElapsed(Client client); String getTotalTimeElapsed(Client client); BigDecimal getTotalAmountEarned(Client client); String getTotalAmountEarned(Client client, Locale locale);  }