Beispiel #1
0
 @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());
 }
Beispiel #2
0
 @Test
 public void all_emptyAtFirst() {
   assertEquals(Task.all().size(), 0);
 }
Beispiel #3
0
 @Test
 public void save_returnsTrueIfDescriptionsAretheSame() {
   Task myTask = new Task("Mow the lawn", 1);
   myTask.save();
   assertTrue(Task.all().get(0).equals(myTask));
 }