Skip to content

Commit

Permalink
Edit junit test to match updated output.
Browse files Browse the repository at this point in the history
  • Loading branch information
NaychiMin committed Nov 9, 2023
1 parent df9a2cb commit b92587c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/seedu/cafectrl/parser/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ private static Command prepareListIngredient(Menu menu, String arguments, Ui ui)

if (!matcher.matches()) {
return new IncorrectCommand(ErrorMessages.MISSING_ARGUMENT_FOR_LIST_INGREDIENTS
+ ListSaleByDayCommand.MESSAGE_USAGE, ui);
+ ListIngredientCommand.MESSAGE_USAGE, ui);
}

try {
Expand Down
7 changes: 4 additions & 3 deletions src/test/java/seedu/cafectrl/parser/ParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public void parseCommand_missingIndex_returnsErrorMessage() {

IncorrectCommand incorrectCommand = (IncorrectCommand) result;
String feedbackToUser = incorrectCommand.feedbackToUser;
assertEquals(ErrorMessages.MISSING_ARGUMENT_FOR_LIST_INGREDIENTS, feedbackToUser);
assertEquals(ErrorMessages.MISSING_ARGUMENT_FOR_LIST_INGREDIENTS + ListIngredientCommand.MESSAGE_USAGE,
feedbackToUser);
}

@Test
Expand All @@ -90,7 +91,7 @@ public void parseCommand_invalidIndex_returnsErrorMessage() {

IncorrectCommand incorrectCommand = (IncorrectCommand) result;
String feedbackToUser = incorrectCommand.feedbackToUser;
assertEquals(ErrorMessages.MISSING_ARGUMENT_FOR_LIST_INGREDIENTS, feedbackToUser);
assertEquals(ErrorMessages.INVALID_DISH_INDEX_TO_LIST, feedbackToUser);
}

@Test
Expand All @@ -108,7 +109,7 @@ public void parseCommand_indexOutOfBounds_returnsErrorMessage() {

IncorrectCommand incorrectCommand = (IncorrectCommand) result;
String feedbackToUser = incorrectCommand.feedbackToUser;
assertEquals(ErrorMessages.INVALID_DISH_INDEX, feedbackToUser);
assertEquals(ErrorMessages.UNLISTED_DISH, feedbackToUser);
}

@Test
Expand Down

0 comments on commit b92587c

Please sign in to comment.