diff --git a/src/test/java/corgi/parsers/CommandParserTest.java b/src/test/java/corgi/parsers/CommandParserTest.java index eb5f74be4f..aa8544f9f0 100644 --- a/src/test/java/corgi/parsers/CommandParserTest.java +++ b/src/test/java/corgi/parsers/CommandParserTest.java @@ -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")); } @@ -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")); } diff --git a/src/test/java/corgi/parsers/CommandValidatorTest.java b/src/test/java/corgi/parsers/CommandValidatorTest.java index 67f80e9793..398bdd923f 100644 --- a/src/test/java/corgi/parsers/CommandValidatorTest.java +++ b/src/test/java/corgi/parsers/CommandValidatorTest.java @@ -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()); @@ -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());