package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import seedu.tasklist.commons.core.Messages;
import seedu.tasklist.logic.commands.SaveCommand;
import seedu.tasklist.testutil.TestUtil;
//@@author A0141993X
public class SaveCommandTest extends TaskListGuiTest {
    private static String newFilePath = TestUtil.getFilePathInSandboxFolder("sampleData.xml");

    @Test
    public void save_invalidCommand_errorMessageShown() {
        String command = "saved testFile.xml";
        commandBox.runCommand(command);
        assertResultMessage(Messages.MESSAGE_UNKNOWN_COMMAND);
    }

    @Test
    public void save_invalidExtension_errorMessageShown() {
        String command = "save testFile";
        commandBox.runCommand(command);
        assertResultMessage(String.format(SaveCommand.MESSAGE_INVALID_PATH, "testFile"));
    }

    @Test
    public void save_CorrectFilePath_success() {
        String command = "save " + newFilePath;
        commandBox.runCommand(command);
        assertResultMessage(String.format(SaveCommand.MESSAGE_SUCCESS, newFilePath));
        assertTrue(taskListPanel.isListMatching(td.getTypicalTasks()));
    }

}

@@ -852,32 +852,592 @@
 stFile%22));%0A    %7D
+%0A    @Test%0A    public void save_validFilePathCreateFile_success() %7B%0A        String command = %22save data/testTasklist.xml%22;%0A        commandBox.runCommand(command);%0A        assertResultMessage(String.format(SaveCommand.MESSAGE_SUCCESS, %22data/testTasklist.xml%22));%0A    %7D%0A    %0A    @Test%0A    public void save_validFilePathCreateDirectory_success() %7B%0A        String command = %22save testSave/data/testTasklist.xml%22;%0A        commandBox.runCommand(command);%0A        assertResultMessage(String.format(SaveCommand.MESSAGE_SUCCESS, %22testSave/data/testTasklist.xml%22));%0A    %7D
 %0A%0A    @Test%0A    

Add more test cases