|
|
@@ -1,31 +0,0 @@
|
|
1
|
|
-package com.zipcoder.payment;
|
|
2
|
|
-
|
|
3
|
|
-import org.junit.Assert;
|
|
4
|
|
-import org.junit.Test;
|
|
5
|
|
-
|
|
6
|
|
-public class PaymentSortByIdTest {
|
|
7
|
|
- Check ch = new Check(1, "Sansa Stark", "1234567", "987654321");
|
|
8
|
|
- PayPal pp = new PayPal(1, "Catelyn Stark", "ladystark@winterfell.com");
|
|
9
|
|
- CreditCard cc = new CreditCard(123, "Robb Stark", "4444444444", 12, 2020);
|
|
10
|
|
- Check ch2 = new Check(900, "Arya Stark", "1234569", "987654444");
|
|
11
|
|
-
|
|
12
|
|
- PaymentSortById psbi = new PaymentSortById();
|
|
13
|
|
-
|
|
14
|
|
-
|
|
15
|
|
- @Test
|
|
16
|
|
- public void paymentSortByIdTest1() {
|
|
17
|
|
- int expected = 0;
|
|
18
|
|
- int actual = psbi.compare(ch, pp);
|
|
19
|
|
- Assert.assertEquals(expected, actual);
|
|
20
|
|
- }
|
|
21
|
|
- @Test
|
|
22
|
|
- public void paymentSortByIdTest2() {
|
|
23
|
|
- int actual = psbi.compare(ch, cc);
|
|
24
|
|
- Assert.assertTrue(actual < 0);
|
|
25
|
|
- }
|
|
26
|
|
- @Test
|
|
27
|
|
- public void paymentSortByIdTest3() {
|
|
28
|
|
- int actual = psbi.compare(ch2, cc);
|
|
29
|
|
- Assert.assertTrue(actual > 0);
|
|
30
|
|
- }
|
|
31
|
|
-}
|