@@ -0,0 +1,2576 @@
+package guitests;%0A%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport org.junit.Test;%0A%0Aimport guitests.guihandles.TaskCardHandle;%0Aimport seedu.cmdo.commons.core.Messages;%0Aimport seedu.cmdo.testutil.TestTask;%0Aimport seedu.cmdo.testutil.TestUtil;%0A%0A/*%0A * @@author A0141128R%0A */%0A//missing block test case with only one time slot%0A//missing test case where you try to add a task to the blocked slot%0A//write test for no allowing to done block task%0A%0Apublic class BlockCommandTest extends ToDoListGuiTest %7B%0A%0A    @Test%0A    public void block() %7B%0A//        //block a time slot without range%0A        TestTask%5B%5D currentList = td.getTypicalTasks();%0A//        TestTask timeToBlock = td.meeting;%0A//        assertBlockSuccess(timeToBlock, currentList);%0A//        currentList = TestUtil.addTasksToList(currentList, timeToBlock);%0A//        %0A        //add task with date/time range%0A        TestTask timeToBlock = td.businessDeal;%0A        assertBlockSuccess(timeToBlock, currentList);%0A        currentList = TestUtil.addTasksToList(currentList, timeToBlock);%0A        %0A        //invalid detail parameter%0A        commandBox.runCommand(%22block 'ppp%22);%0A        assertResultMessage(Messages.MESSAGE_ENCAPSULATE_DETAIL_WARNING);%0A        commandBox.runCommand(%22block ppp'%22);%0A        assertResultMessage(Messages.MESSAGE_ENCAPSULATE_DETAIL_WARNING);%0A        commandBox.runCommand(%22block ''%22);%0A        assertResultMessage(Messages.MESSAGE_BLANK_DETAIL_WARNING);%0A        %0A        //unable to pass test case%0A        //invalid priority parameter%0A        commandBox.runCommand(%22block 'new' /yolo%22);%0A        assertResultMessage(Messages.MESSAGE_INVALID_PRIORITY);%0A        commandBox.runCommand(%22block 'new'/high%22);%0A        assertResultMessage(Messages.MESSAGE_INVALID_PRIORITY_SPACE);%0A        %0A        //add to empty list%0A        commandBox.runCommand(%22clear%22);%0A        assertBlockSuccess(td.deal);%0A%0A        //invalid command%0A        commandBox.runCommand(%22block Johnny%22);%0A        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);%0A    %7D%0A%0A    private void assertBlockSuccess(TestTask timeToBlock, TestTask... currentList) %7B%0A %0A        commandBox.runCommand(timeToBlock.getBlockCommand());%0A%0A        //confirm the new card contains the right data%0A        TaskCardHandle addedCard = taskListPanel.navigateToTask(timeToBlock.getDetail().details);%0A        assertMatching(timeToBlock, addedCard);%0A%0A        //confirm the list now contains the new blocked slot%0A        TestTask%5B%5D expectedList = TestUtil.addTasksToList(currentList, timeToBlock);%0A        assertTrue(taskListPanel.isListMatching(expectedList));%0A    %7D%0A%0A%7D%0A

Test for block command