Skip to content

Commit

Permalink
Modify tests for ArgParser
Browse files Browse the repository at this point in the history
  • Loading branch information
nseah21 committed Dec 25, 2023
1 parent b29e102 commit 3f37760
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/java/reposense/parser/ArgsParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,19 @@ public void sinceDate_laterThanUntilDate_throwsParseException() {

@Test
public void sinceDate_laterThanCurrentDate_throwsParseException() {
LocalDateTime tomorrowDateTime = LocalDateTime.now()
.plusDays(1L);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
String tomorrow = tomorrowDateTime.format(formatter);


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

@Test
public void sinceDate_beforeUntilDateAndLaterThanCurrentDate_throwsParseException() {
LocalDateTime tomorrowDateTime = LocalDateTime.now()
.plusDays(1L);
LocalDateTime dayAfterDateTime = LocalDateTime.now()
Expand Down

0 comments on commit 3f37760

Please sign in to comment.