Skip to content

Commit

Permalink
added function to test another instance of isDuplicate()
Browse files Browse the repository at this point in the history
  • Loading branch information
Aglag257 committed Jun 16, 2024
1 parent 9f36024 commit 8a742a2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/src/test/java/protect/card_locker/LoyaltyCardTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@ public void testIsDuplicate_differentObjects() {

assertFalse(LoyaltyCard.isDuplicate(card1, card2));
}

@Test
public void testIsDuplicate_ignoresLastUsedAndZoomLevel() {
Date now = new Date();
BigDecimal balance = new BigDecimal("50.00");
Currency currency = Currency.getInstance("EUR");
LoyaltyCard card1 = new LoyaltyCard(1, "Store B", "Note B", now, now, balance, currency, "22222", "33333", CatimaBarcode.fromBarcode(BarcodeFormat.PDF_417), 0x00FF00, 1, System.currentTimeMillis(), 5, 1);
LoyaltyCard card2 = new LoyaltyCard(1, "Store B", "Note B", now, now, balance, currency, "22222", "33333", CatimaBarcode.fromBarcode(BarcodeFormat.PDF_417), 0x00FF00, 1, System.currentTimeMillis() + 1000, 10, 1);

assertTrue(LoyaltyCard.isDuplicate(card1, card2));
}
@Test
public void testToString() {
Date now = new Date();
Expand Down

0 comments on commit 8a742a2

Please sign in to comment.