|
|
@@ -21,8 +21,8 @@ public class PaymentPresenterTest {
|
|
21
|
21
|
@Test
|
|
22
|
22
|
public void toStringMultiplePayments() {
|
|
23
|
23
|
Payment[] payment = new Payment[2];
|
|
24
|
|
- Paypal paypal = new Paypal(4L, "Tia Mowry", "tia@mowry.com");
|
|
25
|
|
- Check check = new Check(81L, "Tia Mowry", "11432543", "134344551");
|
|
|
24
|
+ Payment paypal = new Paypal(4L, "Tia Mowry", "tia@mowry.com");
|
|
|
25
|
+ Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
|
|
26
|
26
|
|
|
27
|
27
|
|
|
28
|
28
|
payment[0] = paypal;
|
|
|
@@ -35,10 +35,38 @@ public class PaymentPresenterTest {
|
|
35
|
35
|
assertEquals(expected, actual);
|
|
36
|
36
|
}
|
|
37
|
37
|
|
|
38
|
|
-// paypal.setId(4L); paypal.setPayerName("Tia Mowry"); paypal.setEmail("tia@mowry.com");
|
|
39
|
|
-// check.setId(81L); check.setPayerName("Tia Mowry"); check.setAccountNumber("11432543");
|
|
40
|
|
-// check.setRoutingNumber("134344551");
|
|
|
38
|
+ @Test
|
|
|
39
|
+ public void toStringByPayerName() {
|
|
|
40
|
+ Payment[] payment = new Payment[2];
|
|
|
41
|
+ Payment paypal = new Paypal(4L, "Tamara Mowry", "tamara@mowry.com");
|
|
|
42
|
+ Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
|
|
|
43
|
+
|
|
|
44
|
+ payment[0] = paypal;
|
|
|
45
|
+ payment[1] = check;
|
|
|
46
|
+
|
|
|
47
|
+ PaymentPresenter presenter = new PaymentPresenter();
|
|
|
48
|
+ String expected = "Paypal Tamara Mowry tamara@mowry.com\nCheck Tia Mowry ***4551\n";
|
|
|
49
|
+
|
|
|
50
|
+ String actual = presenter.toStringByPayerName(payment);
|
|
|
51
|
+ assertEquals(expected, actual);
|
|
|
52
|
+ }
|
|
|
53
|
+
|
|
|
54
|
+ @Test
|
|
|
55
|
+ public void toStringById() {
|
|
|
56
|
+ Payment[] payment = new Payment[2];
|
|
|
57
|
+ Payment paypal = new Paypal(120L, "Tamara Mowry", "tamara@mowry.com");
|
|
|
58
|
+ Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
|
|
|
59
|
+
|
|
|
60
|
+ payment[0] = paypal;
|
|
|
61
|
+ payment[1] = check;
|
|
|
62
|
+
|
|
|
63
|
+ PaymentPresenter presenter = new PaymentPresenter();
|
|
|
64
|
+ String expected = "Paypal Tia Mowry tamara@mowry.com\nCheck Tamara Mowry ***4551\n";
|
|
|
65
|
+
|
|
|
66
|
+ String actual = presenter.toStringById(payment);
|
|
|
67
|
+ assertEquals(expected, actual);
|
|
41
|
68
|
|
|
42
|
69
|
}
|
|
|
70
|
+}
|
|
43
|
71
|
|
|
44
|
72
|
|