forked from nus-cs2103-AY1617S2/addressbook-level4
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add tests for save command * update save test
- Loading branch information
1 parent
8cb390f
commit ab30344
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//@@author A0148052L | ||
package guitests; | ||
|
||
import org.junit.Test; | ||
|
||
import onlythree.imanager.logic.commands.SaveCommand; | ||
|
||
public class SaveCommandTest extends TaskListGuiTest { | ||
|
||
@Test | ||
public void saveFile_relativeFilePath_successful() { | ||
String filePath = "data" + "\\" + "taskList.xml"; | ||
assertSaveSuccess(filePath); | ||
} | ||
|
||
@Test | ||
public void saveFile_relativeFileName_fileNameError() { | ||
commandBox.runCommand("save " + "data" + "\\" + ".xml"); | ||
assertResultMessage(SaveCommand.MESSAGE_INVALID_FILE_NAME); | ||
} | ||
|
||
private void assertSaveSuccess(String filePath) { | ||
commandBox.runCommand("save " + filePath); | ||
assertResultMessage(String.format(SaveCommand.MESSAGE_SUCCESS, filePath)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters