@Test public void find_findsTaskInDatabase_true() { Task myTask = new Task("Mow the lawn", 1); myTask.save(); Task savedTask = Task.find(myTask.getId()); assertTrue(myTask.equals(savedTask)); }
@Test public void save_savesCategoryIdIntoDB_true() { Category myCategory = new Category("Household chores"); myCategory.save(); Task myTask = new Task("Mow the lawn", myCategory.getId()); myTask.save(); Task savedTask = Task.find(myTask.getId()); assertEquals(savedTask.getCategoryId(), myCategory.getId()); }