Przeglądaj źródła

corrected tests

Tommy Rogers 8 lat temu
rodzic
commit
480dea91fd

+ 2
- 2
src/test/java/com/zipcoder/payment/CheckTest.java Wyświetl plik

@@ -62,8 +62,8 @@ public class CheckTest {
62 62
 
63 63
     @org.junit.Test
64 64
     public void compareTo(){
65
-        Check check = new Check("Jimmy Dean", "297393022");
66
-        PayPal pp = new PayPal("Slim Shady", "TheRealSlimShady@pleasestandup.com");
65
+        Check check = new Check(889L, "Jimmy Dean", "297393022", "28774821");
66
+        PayPal pp = new PayPal(993L,"Slim Shady", "TheRealSlimShady@pleasestandup.com");
67 67
 
68 68
         assertTrue(check.compareTo(pp) < 0 );
69 69
     }

+ 2
- 2
src/test/java/com/zipcoder/payment/CreditCardTest.java Wyświetl plik

@@ -73,8 +73,8 @@ public class CreditCardTest {
73 73
 
74 74
     @org.junit.Test
75 75
     public void compareTo(){
76
-        CreditCard cc = new CreditCard("Jimmy Dean", "1023 2983 0839 2938", 9, 2040);
77
-        PayPal pp = new PayPal("Slim Shady", "TheRealSlimShady@pleasestandup.com");
76
+        CreditCard cc = new CreditCard(889L,"Jimmy Dean", "1023 2983 0839 2938", 9, 2040);
77
+        PayPal pp = new PayPal(993L,"Slim Shady", "TheRealSlimShady@pleasestandup.com");
78 78
 
79 79
         assertTrue(cc.compareTo(pp) < 0 );
80 80
     }

+ 2
- 2
src/test/java/com/zipcoder/payment/PayPalTest.java Wyświetl plik

@@ -52,8 +52,8 @@ public class PayPalTest {
52 52
 
53 53
     @org.junit.Test
54 54
     public void compareTo(){
55
-        CreditCard cc = new CreditCard("Jimmy Dean", "1023 2983 0839 2938", 9, 2040);
56
-        PayPal pp = new PayPal("Slim Shady", "TheRealSlimShady@pleasestandup.com");
55
+        CreditCard cc = new CreditCard(889L,"Jimmy Dean", "1023 2983 0839 2938", 9, 2040);
56
+        PayPal pp = new PayPal(991L,"Slim Shady", "TheRealSlimShady@pleasestandup.com");
57 57
 
58 58
         assertTrue(cc.compareTo(pp) < 0 );
59 59
     }

+ 12
- 5
src/test/java/com/zipcoder/payment/PaymentPresenterTest.java Wyświetl plik

@@ -43,13 +43,16 @@ public class PaymentPresenterTest {
43 43
     //Create a test case to test the toStringByPayerName method of the PaymentPresenter class
44 44
     @Test
45 45
     public void toStringByPayerName(){
46
-        Payment[] payment = new Payment[1];
46
+        Payment[] payment = new Payment[2];
47 47
         Payment paypal = new PayPal(120L, "Tamara Mowry", "tamara@mowry.com");
48
+        Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
49
+
48 50
 
49 51
         payment[0] = paypal;
52
+        payment[1] = check;
50 53
         PaymentPresenter presenter = new PaymentPresenter();
51 54
 
52
-        String expected = "Paypal Tamara Mowry tamara@mowry.com";
55
+        String expected = "Paypal Tamara Mowry tamara@mowry.com\nCheck Tia Mowry ***2543\n";
53 56
         String actual = presenter.toStringByPayerName(payment);
54 57
         assertEquals(expected, actual);
55 58
 
@@ -80,13 +83,17 @@ public class PaymentPresenterTest {
80 83
 
81 84
     @Test
82 85
     public void toStringById(){
83
-        Payment[] payment = new Payment[1];
84
-        Payment paypal = new PayPal(120L, "Tamara Mowry", "tamara@mowry.com");
86
+        Payment[] payment = new Payment[2];
87
+        Payment paypal = new PayPal(4L, "Tamara Mowry", "tamara@mowry.com");
88
+        Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
89
+
85 90
 
86 91
         payment[0] = paypal;
92
+        payment[1] = check;
93
+
87 94
         PaymentPresenter presenter = new PaymentPresenter();
88 95
 
89
-        String expected = "Paypal Tamara Mowry tamara@mowry.com";
96
+        String expected = "Paypal Tamara Mowry tamara@mowry.com\nCheck Tia Mowry ***2543\n";
90 97
         String actual = presenter.toStringById(payment);
91 98
         assertEquals(expected, actual);
92 99