Skip to content

Commit 8a742a2

Browse files
committed
added function to test another instance of isDuplicate()
1 parent 9f36024 commit 8a742a2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/src/test/java/protect/card_locker/LoyaltyCardTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,16 @@ public void testIsDuplicate_differentObjects() {
7272

7373
assertFalse(LoyaltyCard.isDuplicate(card1, card2));
7474
}
75-
75+
@Test
76+
public void testIsDuplicate_ignoresLastUsedAndZoomLevel() {
77+
Date now = new Date();
78+
BigDecimal balance = new BigDecimal("50.00");
79+
Currency currency = Currency.getInstance("EUR");
80+
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);
81+
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);
82+
83+
assertTrue(LoyaltyCard.isDuplicate(card1, card2));
84+
}
7685
@Test
7786
public void testToString() {
7887
Date now = new Date();

0 commit comments

Comments
 (0)