Skip to content

Commit

Permalink
Fix tests for sort command parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
kaajinn committed Oct 28, 2024
1 parent 440e0ac commit 32c4cf6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

public class AddressBookParserTest {

private static final String VALID_ATTRIBUTE = "date";
private final AddressBookParser parser = new AddressBookParser();

@Test
Expand Down Expand Up @@ -108,12 +109,14 @@ public void parseCommand_list() throws Exception {

@Test
public void parseCommand_ascendingSort() throws Exception {
assertTrue(parser.parseCommand(SortCommand.COMMAND_WORD_ASCENDING) instanceof SortCommand);
String userInput = SortCommand.COMMAND_WORD_ASCENDING + " " + CliSyntax.PREFIX_SORT + " " + VALID_ATTRIBUTE;
assertTrue(parser.parseCommand(userInput) instanceof SortCommand);
}

@Test
public void parseCommand_descendingSort() throws Exception {
assertTrue(parser.parseCommand(SortCommand.COMMAND_WORD_DESCENDING) instanceof SortCommand);
String userInput = SortCommand.COMMAND_WORD_DESCENDING + " " + CliSyntax.PREFIX_SORT + " " + VALID_ATTRIBUTE;
assertTrue(parser.parseCommand(userInput) instanceof SortCommand);
}

@Test
Expand Down

0 comments on commit 32c4cf6

Please sign in to comment.