|
|
@@ -30,4 +30,34 @@ public class PaymentPresenterTest {
|
|
30
|
30
|
String actual = presenter.toString(payments);
|
|
31
|
31
|
assertEquals(expected, actual);
|
|
32
|
32
|
}
|
|
|
33
|
+ @Test
|
|
|
34
|
+ public void toStringByPayerName(){
|
|
|
35
|
+ Payment[] payments = new Payment[2];
|
|
|
36
|
+ Payment paypal = new Paypal(4L, "Tamara Mowry", "tamara@mowry.com");
|
|
|
37
|
+ Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551")
|
|
|
38
|
+
|
|
|
39
|
+ payments[0] = paypal;
|
|
|
40
|
+ payments[1] = check;
|
|
|
41
|
+
|
|
|
42
|
+ PaymentPresenter presenter = new PaymentPresenter();
|
|
|
43
|
+ String expected = "Paypal Tamara Mowry tamara@mowry.com\nCheck Tia Mowry ***4551\n";
|
|
|
44
|
+
|
|
|
45
|
+ String actual = presenter.toStringByPayerName(payments);
|
|
|
46
|
+ assertEquals(expected, actual);
|
|
|
47
|
+ }
|
|
|
48
|
+ @Test
|
|
|
49
|
+ public void toStringByID(){
|
|
|
50
|
+ Payment[] payments = new Payment[2];
|
|
|
51
|
+ Payment paypal = new Paypal(120L, "Tamara Mowry", "tamara@mowry.com");
|
|
|
52
|
+ Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551")
|
|
|
53
|
+
|
|
|
54
|
+ payments[0] = paypal;
|
|
|
55
|
+ payments[1] = check;
|
|
|
56
|
+
|
|
|
57
|
+ PaymentPresenter presenter = new PaymentPresenter();
|
|
|
58
|
+ String expected = "Paypal Tamara Mowry tamara@mowry.com\nCheck Tia Mowry ***4551\n";
|
|
|
59
|
+
|
|
|
60
|
+ String actual = presenter.toStringById(payments);
|
|
|
61
|
+ assertEquals(expected, actual);
|
|
|
62
|
+ }
|
|
33
|
63
|
}
|