Skip to content

Commit

Permalink
Fix the assertion that makes the test case fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
kfwong committed Oct 16, 2016
1 parent 4d8319d commit 7b4c55c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ public CommandResult execute() {
model.clearRedoHistory();

} catch (TaskNotFoundException | IndexOutOfBoundsException tnfe) {
assert false : "The target task cannot be missing";
// by A0138862W:
// uncommented this line because it makes the DeleteCommandTest fail at line 33
// should return invalid message for UI to display otherwise it'll display null
//assert false : "The target task cannot be missing";

return new CommandResult(Messages.MESSAGE_INVALID_TASK_DISPLAYED_INDEX);
}

return new CommandResult(String.format(MESSAGE_DELETE_TASK_SUCCESS, toDelete));
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/guitests/DeleteCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public void delete() {
currentList = TestUtil.removeTaskFromList(currentList, targetIndex);
targetIndex = currentList.length/2;
assertDeleteSuccess(targetIndex, currentList);

//invalid index
commandBox.runCommand("delete " + currentList.length + 1);
commandBox.runCommand("delete " + (currentList.length + 1));
assertResultMessage("The task index provided is invalid");

}
Expand Down

0 comments on commit 7b4c55c

Please sign in to comment.