package guitests;

import org.junit.Test;

import seedu.taskitty.logic.commands.PathCommand;

//@@author A0135793W
public class PathCommandTest extends TaskManagerGuiTest {

    @Test
    public void save() {
        commandBox.runCommand("path temp.xml");
        assertResultMessage(String.format(PathCommand.MESSAGE_SUCCESS, "temp.xml"));
        
        //no filepath
        commandBox.runCommand("path");
        assertResultMessage(String.format(PathCommand.MESSAGE_INVALID_MISSING_FILEPATH, 
                PathCommand.MESSAGE_VALID_FILEPATH_USAGE));
        
        commandBox.runCommand("path ");
        assertResultMessage(String.format(PathCommand.MESSAGE_INVALID_MISSING_FILEPATH, 
                PathCommand.MESSAGE_VALID_FILEPATH_USAGE));
        
        //file name does not end with .xml
        commandBox.runCommand("path temp");
        assertResultMessage(String.format(PathCommand.MESSAGE_INVALID_FILEPATH, 
                PathCommand.MESSAGE_VALID_FILEPATH_USAGE));
        
        commandBox.runCommand("path t");
        assertResultMessage(String.format(PathCommand.MESSAGE_INVALID_FILEPATH, 
                PathCommand.MESSAGE_VALID_FILEPATH_USAGE));
        
        commandBox.runCommand("path temp.pdf");
        assertResultMessage(String.format(PathCommand.MESSAGE_INVALID_FILEPATH, 
                PathCommand.MESSAGE_VALID_FILEPATH_USAGE));
        
    }

}

@@ -12,16 +12,38 @@
 tests;%0A%0A
+import java.io.File;%0A%0A
 import o
@@ -57,16 +57,16 @@
 t.Test;%0A
-
 %0Aimport 
@@ -219,12 +219,12 @@
 oid 
-save
+path
 () %7B
@@ -268,24 +268,24 @@
 temp.xml%22);%0A
-
         asse
@@ -358,32 +358,168 @@
 ml%22));%0A        %0A
+        // delete temp file after testing is complete%0A        File tempFile = new File(%22temp.xml%22);%0A        tempFile.delete();%0A        %0A
         //no fil

Update PathCommandTest to delete the temp file after the relevant test is completed to avoid errors in the future tests