@Test public void save_assignsIdToObject() { Task myTask = new Task("Mow the lawn", 1); myTask.save(); Task savedTask = Task.all().get(0); assertEquals(myTask.getId(), savedTask.getId()); }
@Test public void all_emptyAtFirst() { assertEquals(Task.all().size(), 0); }
@Test public void save_returnsTrueIfDescriptionsAretheSame() { Task myTask = new Task("Mow the lawn", 1); myTask.save(); assertTrue(Task.all().get(0).equals(myTask)); }