Skip to content

Commit

Permalink
Change from 1 entries to 1 entry AY2324S1-CS2113T-W11-2#212
Browse files Browse the repository at this point in the history
  • Loading branch information
woodenclock committed Nov 9, 2023
1 parent b5eb9bc commit af1b891
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/main/java/seedu/wildwatch/ui/ListCommandPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ public static void listMessagePrinter() {
}

public static void entryCountPrinter() {
System.out.println("Now you have " + (EntryList.getArraySize()) + " entries in the list.");
if (EntryList.getArraySize() == 0) {
System.out.println("Now you have no entries in the list.");
} else if (EntryList.getArraySize() == 1) {
System.out.println("Now you have 1 entry in the list.");
} else {
System.out.println("Now you have " + (EntryList.getArraySize()) + " entries in the list.");
}
}
}
2 changes: 1 addition & 1 deletion src/test/java/seedu/wildwatch/command/ListCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void listEntryWithZeroEntry() {
clearEntryList();
ListCommand.listEntry();
String consoleOutput = mockOutput.toString();
String expectedOutput = "Now you have 0 entries in the list."
String expectedOutput = "Now you have no entries in the list."
+ "\n";
consoleOutput = consoleOutput.replace(System.lineSeparator(), "\n");
assertEquals(expectedOutput, consoleOutput);
Expand Down

0 comments on commit af1b891

Please sign in to comment.