@@ -0,0 +1,2117 @@
+package test;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Date;%0Aimport java.util.List;%0A%0Aimport model.FixedTask;%0Aimport model.FloatingTask;%0Aimport model.TaskList;%0A%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0Apublic class TaskListTest %7B%0A%0A%09@BeforeClass%0A%09public static void setUpBeforeClass() throws Exception %7B%0A%09%7D%0A%0A%09@Test%0A%09public void testAddingTask() %7B%0A%09%09TaskList tasks = new TaskList();%0A%09%09// generate 50 dummy task and add them%0A%09%09 for (int i = 0; i %3C 50; i++) %7B%0A%09            tasks.addToList(new FloatingTask(%22No.%22 + i));%0A%09%09%7D%0A%09%09assertEquals(50, tasks.count());%0A%09%7D%0A%09%0A%09@Test%0A%09public void testDeletingTask() %7B%0A%09%09TaskList tasks = new TaskList();%0A%09%09// generate 50 dummy task and add them%0A%09%09 for (int i = 0; i %3C 50; i++) %7B%0A%09            tasks.addToList(new FloatingTask(%22No.%22 + i));%0A%09%09%7D%0A%09%09assertEquals(50, tasks.count());%0A%09%09%0A%09%09// delete single task%0A%09%09List%3CInteger%3E toDelete = new ArrayList%3CInteger%3E();%0A%09%09toDelete.add(1);%0A%09%09try %7B%0A%09%09%09tasks.deleteFromList(toDelete);%0A%09%09%7D catch (IndexOutOfBoundsException e) %7B%0A%09%09%09System.out.println(e.getMessage());%0A%09%09%7D%0A%09%09assertEquals(49, tasks.count());%0A%09%09%0A%09%09//delete multiple task%0A%09%09toDelete = new ArrayList%3CInteger%3E();%0A%09%09for (int i = 1; i %3C=25; i++) %7B%0A            toDelete.add(i);%0A%09%09%7D%0A%09%09try %7B%0A%09%09%09tasks.deleteFromList(toDelete);%0A%09%09%7D catch (IndexOutOfBoundsException e) %7B%0A%09%09%09System.out.println(e.getMessage());%0A%09%09%7D%0A%09%09assertEquals(24, tasks.count());%0A%09%09%0A%09%09// clear tasks%0A%09%09tasks.clearList();%0A%09%09assertEquals(0, tasks.count());%0A%09%7D%0A%09%0A%09public void testEditingTask() %7B%0A%09%09TaskList tasks = new TaskList();%0A%09%09// editing floating task%0A%09%09FloatingTask floatTask = new FloatingTask(%22lowercase%22);%0A%09%09tasks.addToList(floatTask);%0A%09%09tasks.editTaskDescription(1, %22UPPERCASE%22);%0A%09%09assertEquals(%22UPPERCASE%22, tasks.get(0).getDescription());%0A%09%09%0A%09%09tasks.clearList();%0A%09%09// editing floating task%0A%09%09Date dateA = new Date(100);%0A%09%09Date dateB = new Date(200);%0A%09%09Date dateC = new Date(300);%0A%09%09FixedTask fixedTask = new FixedTask(%22lowercase%22, dateA, dateB);%0A%09%09tasks.addToList(fixedTask);%0A%09%09tasks.editTaskStartDate(1, dateC);%0A%09%09assertEquals(dateC, tasks.get(0).getDeadline());%0A%09%7D%0A%0A%7D%0A

Add unit test for TaskList class.