Skip to content

Commit

Permalink
CardDbCardMockTestCase.testNullAndBoundaryDateValuesForGetCardFromEdi…
Browse files Browse the repository at this point in the history
…tionsWithDateRestrictions allow for future-dated latestShivanDragon
  • Loading branch information
Northmoc committed Sep 7, 2022
1 parent 65348e8 commit 152e435
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1748,22 +1748,24 @@ public void testNullAndBoundaryDateValuesForGetCardFromEditionsWithDateRestricti
assertEquals(shivanDragon.getName(), cardNameShivanDragon);
assertEquals(shivanDragon.getEdition(), latestArtShivanDragonEdition);

Date alphaRelaseDate = null;
Date alphaReleaseDate = null;
Date currentDate = Date.from(Instant.now());
Date latestShivanDragonReleaseDateToDate = null; // latest print to date for Shivan is in P30H
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
alphaRelaseDate = format.parse(alphaEditionReleaseDate);
alphaReleaseDate = format.parse(alphaEditionReleaseDate);
latestShivanDragonReleaseDateToDate = format.parse("2022-09-09");
} catch (ParseException e) {
e.printStackTrace();
fail();
}

assertNull(this.cardDb.getCardFromEditionsReleasedBefore(cardNameShivanDragon, alphaRelaseDate));
assertNull(this.cardDb.getCardFromEditionsReleasedAfter(cardNameShivanDragon, currentDate));
assertNull(this.cardDb.getCardFromEditionsReleasedBefore(cardNameShivanDragon, alphaReleaseDate));
assertNull(this.cardDb.getCardFromEditionsReleasedAfter(cardNameShivanDragon,
latestShivanDragonReleaseDateToDate));
if (currentDate.after(latestShivanDragonReleaseDateToDate)) {
assertNull(this.cardDb.getCardFromEditionsReleasedAfter(cardNameShivanDragon, currentDate));
}
}

@Test
Expand Down

0 comments on commit 152e435

Please sign in to comment.