Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nixonwidjaja committed Oct 18, 2023
1 parent 01f1833 commit 2db2300
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public void execute_failure() {
Index outOfBoundIndex = Index.fromOneBased(model.getFilteredPersonList().size() + 1);
LeaveCommand command = new LeaveCommand(outOfBoundIndex, "0000+0000000");
assertCommandFailure(command, model, Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX);
assertCommandFailure(new LeaveCommand(INDEX_FIRST_PERSON, "0000-0000000"), model,
String.format(Leave.ILLEGAL_MONTH, "May"));

Person person = model.getFilteredPersonList().get(INDEX_SECOND_PERSON.getZeroBased());
assertCommandFailure(leaveSecondCommand, model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,9 @@ public void parse_invalidArgs_throwsParseException() {
assertParseFailure(parser, " 1 m/-3,3", LeaveCommand.MESSAGE_AMBIGUOUS + LeaveCommand.MESSAGE_USAGE);

assertParseFailure(parser, " 1 m/z", LeaveCommand.MESSAGE_NOT_A_NUMBER + LeaveCommand.MESSAGE_USAGE);

assertParseFailure(parser, " 1 m/0", LeaveCommand.MESSAGE_INVALID_MONTH + LeaveCommand.MESSAGE_USAGE);

assertParseFailure(parser, " 1 m/13", LeaveCommand.MESSAGE_INVALID_MONTH + LeaveCommand.MESSAGE_USAGE);
}
}

0 comments on commit 2db2300

Please sign in to comment.