Skip to content

Commit

Permalink
Fix checkstyle error
Browse files Browse the repository at this point in the history
  • Loading branch information
NereusWB922 committed Sep 18, 2023
1 parent 6154c7b commit 3060fc6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/test/java/corgi/parsers/CommandParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void parse_invalidTodoCommand_throwsInvalidCommandFormatException() {
assertThrows(InvalidCommandFormatException.class, () ->
parser.parse("todo /desc"));
// Invalid number of same argument
assertThrows(InvalidCommandFormatException.class, () ->
assertThrows(InvalidCommandFormatException.class, () ->
parser.parse("todo /desc task1 /desc hard /desc urgent"));
}

Expand Down Expand Up @@ -181,7 +181,7 @@ public void parse_invalidDeadlineCommand_throwsInvalidCommandFormatException() {
assertThrows(InvalidCommandFormatException.class, () ->
parser.parse("deadline /desc /by 2023-09-22"));
// Invalid number of same argument
assertThrows(InvalidCommandFormatException.class, () ->
assertThrows(InvalidCommandFormatException.class, () ->
parser.parse("deadline /desc task1 /by 2023-09-22 /by 2023-09-23"));
}

Expand Down
24 changes: 12 additions & 12 deletions src/test/java/corgi/parsers/CommandValidatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public void validateArguments_invalidNumberOfArguments_throwsInvalidCommandForma
arguments.add("/arg2");
arguments.add("/arg3");

InvalidCommandFormatException exception1 = assertThrows(InvalidCommandFormatException.class,
() -> validator.validateArguments(command1, arguments));
InvalidCommandFormatException exception2 = assertThrows(InvalidCommandFormatException.class,
() -> validator.validateArguments(command2, arguments));
InvalidCommandFormatException exception3 = assertThrows(InvalidCommandFormatException.class,
() -> validator.validateArguments(command3, arguments));
InvalidCommandFormatException exception1 = assertThrows(InvalidCommandFormatException.class, () ->
validator.validateArguments(command1, arguments));
InvalidCommandFormatException exception2 = assertThrows(InvalidCommandFormatException.class, () ->
validator.validateArguments(command2, arguments));
InvalidCommandFormatException exception3 = assertThrows(InvalidCommandFormatException.class, () ->
validator.validateArguments(command3, arguments));

assertEquals("Invalid number of argument \"/arg1\" !", exception1.getMessage());
assertEquals("Invalid number of argument \"/arg2\" !", exception2.getMessage());
Expand All @@ -48,12 +48,12 @@ public void validateArguments_missingArguments_throwsInvalidCommandFormatExcepti
arguments.add("/arg2");
arguments.add("/arg3");

InvalidCommandFormatException exception1 = assertThrows(InvalidCommandFormatException.class,
() -> validator.validateArguments(command1, arguments));
InvalidCommandFormatException exception2 = assertThrows(InvalidCommandFormatException.class,
() -> validator.validateArguments(command2, arguments));
InvalidCommandFormatException exception3 = assertThrows(InvalidCommandFormatException.class,
() -> validator.validateArguments(command3, arguments));
InvalidCommandFormatException exception1 = assertThrows(InvalidCommandFormatException.class, () ->
validator.validateArguments(command1, arguments));
InvalidCommandFormatException exception2 = assertThrows(InvalidCommandFormatException.class, () ->
validator.validateArguments(command2, arguments));
InvalidCommandFormatException exception3 = assertThrows(InvalidCommandFormatException.class, () ->
validator.validateArguments(command3, arguments));

assertEquals("Missing argument \"/arg1\" !", exception1.getMessage());
assertEquals("Missing argument \"/arg2\" !", exception2.getMessage());
Expand Down

0 comments on commit 3060fc6

Please sign in to comment.