@@ -0,0 +1,2076 @@
+package guitests;%0A%0Aimport static org.junit.Assert.*;%0Aimport static seedu.jimi.logic.commands.DeleteCommand.MESSAGE_DELETE_TASK_SUCCESS;%0A%0Aimport org.junit.Test;%0A%0Aimport seedu.jimi.testutil.TestFloatingTask;%0Aimport seedu.jimi.testutil.TestUtil;%0A%0Apublic class CompleteCommandTest extends AddressBookGuiTest %7B%0A%0A    @Test%0A    public void complete() %7B%0A%0A        //complete the first task in the list%0A        TestFloatingTask%5B%5D currentList = td.getTypicalTasks();%0A        int targetIndex = 1;%0A        assertCompleteSuccess(targetIndex, currentList);%0A%0A        //complete the last in the list%0A        currentList = TestUtil.completeTaskFromList(currentList, targetIndex);%0A        targetIndex = currentList.length;%0A        assertCompleteSuccess(targetIndex, currentList);%0A%0A        //complete from the middle of the list%0A        currentList = TestUtil.completeTaskFromList(currentList, targetIndex);%0A        targetIndex = currentList.length/2;%0A        assertCompleteSuccess(targetIndex, currentList);%0A%0A        //invalid index%0A        commandBox.runCommand(%22complete %22 + currentList.length + 1);%0A        assertResultMessage(%22The task index provided is invalid%22);%0A%0A    %7D%0A%0A    /**%0A     * Runs the complete command to complete the task at specified index and confirms the result is correct.%0A     * @param targetIndexOneIndexed e.g. to delete the first task in the list, 1 should be given as the target index.%0A     * @param currentList A copy of the current list of tasks (before completion).%0A     */%0A    private void assertCompleteSuccess(int targetIndexOneIndexed, final TestFloatingTask%5B%5D currentList) %7B%0A        TestFloatingTask taskToComplete = currentList%5BtargetIndexOneIndexed-1%5D; //-1 because array uses zero indexing%0A%0A        commandBox.runCommand(%22complete %22 + targetIndexOneIndexed);%0A%0A        //confirm the list now contains the task being set to complete%0A        assertTrue(taskListPanel.getTask(targetIndexOneIndexed).isCompleted());%0A%0A        //confirm the result message is correct%0A        assertResultMessage(String.format(MESSAGE_DELETE_TASK_SUCCESS, taskToComplete));%0A    %7D%0A%0A%7D%0A

Add JUnit tests for CompleteCommand