@@ -0,0 +1,2814 @@
+package guitests;%0A%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport org.junit.Test;%0A%0Aimport seedu.tasklist.commons.core.Messages;%0Aimport seedu.tasklist.logic.commands.SortCommand;%0Aimport seedu.tasklist.testutil.TestTask;%0A%0Apublic class SortCommandTest extends TaskListGuiTest %7B%0A%0A%0A    @Test%0A    public void sort_invalidParameter_errorMessageShown() %7B%0A        String command = %22sort a%22;%0A        commandBox.runCommand(command);%0A        assertResultMessage(String.format(SortCommand.MESSAGE_FAILURE));%0A    %7D%0A%0A    @Test%0A    public void sort_moreThanOneParameter_errorMessageShown() %7B%0A        String command = %22sort n p%22;%0A        commandBox.runCommand(command);%0A        assertResultMessage(String.format(SortCommand.MESSAGE_FAILURE));%0A    %7D%0A%0A    @Test%0A    public void sort_invalidCommand_errorMessageShown() %7B%0A        commandBox.runCommand(%22sorts newTask%22);%0A        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);%0A    %7D%0A%0A    @Test%0A    public void sort() %7B%0A        //sort by name%0A        TestTask%5B%5D expectedListName = %7Btd.groceries, td.tutorial, td.homework, td.drink, td.cs2103T, td.java%7D;%0A        String commandName = %22sort n%22;%0A        commandBox.runCommand(commandName);%0A        assertSortSuccess(expectedListName);%0A%0A        //sort by start date%0A        TestTask%5B%5D expectedListStartDate = %7Btd.tutorial, td.cs2103T, td.groceries, td.homework, td.drink, td.java %7D;%0A        String commandStartDate = %22sort sd%22;%0A        commandBox.runCommand(commandStartDate);%0A        assertResultMessage(SortCommand.MESSAGE_SUCCESS);%0A        assertSortSuccess(expectedListStartDate);%0A%0A        //sort by end date%0A        TestTask%5B%5D expectedListEndDate = %7Btd.tutorial, td.cs2103T, td.groceries, td.homework, td.drink, td.java%7D;%0A        String commandEndDate = %22sort ed%22;%0A        commandBox.runCommand(commandEndDate);%0A        assertResultMessage(SortCommand.MESSAGE_SUCCESS);%0A        assertSortSuccess(expectedListEndDate);%0A%0A        //sort by deadline date%0A        TestTask%5B%5D expectedListDeadline =  %7Btd.cs2103T, td.tutorial, td.groceries, td.homework, td.drink, td.java%7D;%0A        String commandDeadline = %22sort d%22;%0A        commandBox.runCommand(commandDeadline);%0A        assertResultMessage(SortCommand.MESSAGE_SUCCESS);%0A        assertSortSuccess(expectedListDeadline);%0A%0A        //sort by start priority%0A        TestTask%5B%5D expectedListPriority = %7Btd.tutorial, td.drink, td.java, td.cs2103T, td.groceries, td.homework%7D;%0A        String commandPriority = %22sort p%22;%0A        commandBox.runCommand(commandPriority);%0A        assertResultMessage(SortCommand.MESSAGE_SUCCESS);%0A        assertSortSuccess(expectedListPriority);%0A    %7D%0A%0A    private void assertSortSuccess(TestTask... expectedList) %7B%0A        //confirm list contains all tasks in the correct sorted order%0A        assertTrue(taskListPanel.isListMatching(expectedList));%0A    %7D%0A%0A%7D%0A

Add SortCommandTest.java