Skip to content

Commit

Permalink
Add valid untilDate precondition to test case
Browse files Browse the repository at this point in the history
  • Loading branch information
nseah21 committed Dec 23, 2023
1 parent 6d76aff commit a1f0e17
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/java/reposense/parser/ArgsParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -611,10 +611,15 @@ public void sinceDate_laterThanUntilDate_throwsParseException() {
public void sinceDate_laterThanCurrentDate_throwsParseException() {
LocalDateTime tomorrowDateTime = LocalDateTime.now()
.plusDays(1L);
LocalDateTime dayAfterDateTime = LocalDateTime.now()
.plusDays(2L);

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
String tomorrow = tomorrowDateTime.format(formatter);
String dayAfter = dayAfterDateTime.format(formatter);

String input = DEFAULT_INPUT_BUILDER.addSinceDate(tomorrow)
.addUntilDate(dayAfter)
.build();
Assertions.assertThrows(ParseException.class, () -> ArgsParser.parse(translateCommandline(input)));
}
Expand Down

0 comments on commit a1f0e17

Please sign in to comment.