Soujanya Buragapu 7 лет назад
Родитель
Сommit
05a8fad5d0

+ 8
- 0
pom.xml Просмотреть файл

@@ -7,6 +7,14 @@
7 7
     <groupId>com.zipcoder</groupId>
8 8
     <artifactId>payment</artifactId>
9 9
     <version>1.0-SNAPSHOT</version>
10
+    <dependencies>
11
+        <dependency>
12
+            <groupId>junit</groupId>
13
+            <artifactId>junit</artifactId>
14
+            <version>RELEASE</version>
15
+            <scope>test</scope>
16
+        </dependency>
17
+    </dependencies>
10 18
     <properties>
11 19
         <maven.compiler.source>1.8</maven.compiler.source>
12 20
         <maven.compiler.target>1.8</maven.compiler.target>

+ 63
- 0
src/main/java/com/zipcoder/payment/Check.java Просмотреть файл

@@ -0,0 +1,63 @@
1
+package com.zipcoder.payment;
2
+
3
+public class Check implements Payment
4
+{
5
+    private long id;
6
+    private String payerName;
7
+    private String routingNumber;
8
+    private String accountNumber;
9
+
10
+    public Check(long id, String payerName, String routingNumber, String accountNumber) {
11
+        this.id = id;
12
+        this.payerName = payerName;
13
+        this.routingNumber = routingNumber;
14
+        this.accountNumber = accountNumber;
15
+    }
16
+
17
+    public Check() {
18
+    }
19
+
20
+    public void setId(long id) {
21
+        this.id = id;
22
+    }
23
+
24
+    public void setPayerName(String payerName) {
25
+        this.payerName = payerName;
26
+    }
27
+
28
+    public String getRoutingNumber() {
29
+        return routingNumber;
30
+    }
31
+
32
+    public void setRoutingNumber(String routingNumber) {
33
+        this.routingNumber = routingNumber;
34
+    }
35
+
36
+    public String getAccountNumber() {
37
+        return accountNumber;
38
+    }
39
+
40
+    public void setAccountNumber(String accountNumber) {
41
+        this.accountNumber = accountNumber;
42
+    }
43
+
44
+    @Override
45
+    public long getId() {
46
+        return id;
47
+    }
48
+
49
+    @Override
50
+    public String getPayerName() {
51
+        return payerName;
52
+    }
53
+
54
+    @Override
55
+    public String getShortDescription() {
56
+        return String.format("Check %s ***%s", payerName, accountNumber.substring(accountNumber.length()-4));
57
+    }
58
+
59
+    @Override
60
+    public int compareTo(Payment o) {
61
+        return this.getShortDescription().compareTo(o.getShortDescription());
62
+    }
63
+}

+ 82
- 0
src/main/java/com/zipcoder/payment/CreditCard.java Просмотреть файл

@@ -0,0 +1,82 @@
1
+package com.zipcoder.payment;
2
+
3
+public class CreditCard implements Payment
4
+{
5
+    private long id;
6
+    private String payerName;
7
+    private String number;
8
+    private int expiredMonth;
9
+    private int expiredYear;
10
+
11
+    public CreditCard() {
12
+    }
13
+
14
+    public CreditCard(long id, String payerName, String number, int expiredMonth, int expiredYear) {
15
+        this.id = id;
16
+        this.payerName = payerName;
17
+        this.number = number;
18
+        this.expiredMonth = expiredMonth;
19
+        this.expiredYear = expiredYear;
20
+    }
21
+    public void setId(long id)
22
+    {
23
+        this.id = id;
24
+    }
25
+
26
+    @Override
27
+    public long getId()
28
+    {
29
+        return this.id;
30
+    }
31
+
32
+    public void setPayerName(String payerName)
33
+    {
34
+        this.payerName = payerName;
35
+    }
36
+    @Override
37
+    public String getPayerName() {
38
+        return this.payerName;
39
+    }
40
+
41
+    public String getNumber()
42
+    {
43
+        return number;
44
+    }
45
+
46
+    public void setNumber(String number)
47
+    {
48
+        this.number = number;
49
+    }
50
+
51
+    public int getExpiredMonth()
52
+    {
53
+        return expiredMonth;
54
+    }
55
+
56
+    public void setExpiredMonth(int expiredMonth)
57
+    {
58
+        this.expiredMonth = expiredMonth;
59
+    }
60
+
61
+    public int getExpiredYear()
62
+    {
63
+        return expiredYear;
64
+    }
65
+
66
+    public void setExpiredYear(int expiredYear)
67
+    {
68
+        this.expiredYear = expiredYear;
69
+    }
70
+    @Override
71
+    public String getShortDescription()
72
+    {
73
+        return String.format("CC %s %s %d/%d", payerName, number.substring(number.length()-4), expiredMonth, expiredYear);
74
+    }
75
+
76
+    @Override
77
+    public int compareTo(Payment o)
78
+    {
79
+        return this.getShortDescription().compareTo(o.getShortDescription());
80
+    }
81
+
82
+}

+ 53
- 0
src/main/java/com/zipcoder/payment/PayPal.java Просмотреть файл

@@ -0,0 +1,53 @@
1
+package com.zipcoder.payment;
2
+
3
+public class PayPal implements Payment
4
+{
5
+    private long id;
6
+    private String payerName;
7
+    private String email;
8
+
9
+    public PayPal(long id, String payerName, String email) {
10
+        this.id = id;
11
+        this.payerName = payerName;
12
+        this.email = email;
13
+    }
14
+
15
+    public PayPal() {
16
+    }
17
+
18
+    public void setId(long id) {
19
+        this.id = id;
20
+    }
21
+
22
+    public void setPayerName(String payerName) {
23
+        this.payerName = payerName;
24
+    }
25
+
26
+    public String getEmail() {
27
+        return email;
28
+    }
29
+
30
+    public void setEmail(String email) {
31
+        this.email = email;
32
+    }
33
+
34
+    @Override
35
+    public long getId() {
36
+        return id;
37
+    }
38
+
39
+    @Override
40
+    public String getPayerName() {
41
+        return payerName;
42
+    }
43
+
44
+    @Override
45
+    public String getShortDescription() {
46
+        return String.format("Paypal %s %s", payerName,email);
47
+    }
48
+
49
+    @Override
50
+    public int compareTo(Payment o) {
51
+        return this.getShortDescription().compareTo(o.getShortDescription());
52
+    }
53
+}

+ 13
- 0
src/main/java/com/zipcoder/payment/Payment.java Просмотреть файл

@@ -0,0 +1,13 @@
1
+package com.zipcoder.payment;
2
+
3
+public interface Payment extends Comparable<Payment>
4
+{
5
+
6
+    long getId();
7
+
8
+    String getPayerName();
9
+
10
+    String getShortDescription();
11
+
12
+
13
+}

+ 56
- 1
src/main/java/com/zipcoder/payment/PaymentPresenter.java Просмотреть файл

@@ -1,6 +1,61 @@
1 1
 package com.zipcoder.payment;
2 2
 
3
-public class PaymentPresenter {
3
+public class PaymentPresenter
4
+{
5
+    public String toString(Payment [] payments){
6
+        Payment temp;
7
+        for (int i = 0; i < payments.length; i++) {
8
+            for (int j = i + 1; j < payments.length; j++) {
9
+                if (payments[i].compareTo(payments[j]) > 0) {
10
+                    temp = payments[j];
11
+                    payments[j] = payments[i];
12
+                    payments[i] = temp;
13
+                }
14
+            }
15
+        }
4 16
 
17
+        String paymentsList = "";
18
+        for (Payment payment : payments) {
19
+            paymentsList += payment.getShortDescription() + "\n";
20
+        }
21
+        return paymentsList;
22
+    }
5 23
 
24
+    public String toStringByPayerName(Payment[] payments) {
25
+        PaymentSortByPayer paymentSortByPayer = new PaymentSortByPayer();
26
+        Payment temp;
27
+        for (int i = 0; i < payments.length; i++) {
28
+            for (int j = i + 1; j < payments.length; j++) {
29
+                if (paymentSortByPayer.compare(payments[i], (payments[j])) > 0) {
30
+                    temp = payments[j];
31
+                    payments[j] = payments[i];
32
+                    payments[i] = temp;
33
+                }
34
+            }
35
+        }
36
+        String paymentsList = "";
37
+        for (Payment payment : payments) {
38
+            paymentsList += payment.getShortDescription() + "\n";
39
+        }
40
+        return paymentsList;
41
+    }
42
+    public String toStringById(Payment[] payments) {
43
+
44
+        Payment temp;
45
+        for (int i = 0; i < payments.length; i++) {
46
+            for (int j = i + 1; j < payments.length; j++) {
47
+                if (payments[i].getId() > payments[j].getId()) {
48
+                    temp = payments[j];
49
+                    payments[j] = payments[i];
50
+                    payments[i] = temp;
51
+                }
52
+            }
53
+        }
54
+
55
+        String paymentsList = "";
56
+        for (Payment payment : payments) {
57
+            paymentsList += payment.getShortDescription() + "\n";
58
+        }
59
+        return paymentsList;
60
+    }
6 61
 }

+ 38
- 0
src/main/java/com/zipcoder/payment/PaymentSortByPayer.java Просмотреть файл

@@ -0,0 +1,38 @@
1
+package com.zipcoder.payment;
2
+import java.util.Comparator;
3
+
4
+/*public class PaymentSortByPayer implements Comparator<Payment>
5
+{
6
+    @Override
7
+    public int compare(Payment o1, Payment o2) {
8
+        return o1.getPayerName().compareTo(o2.getPayerName());
9
+    }
10
+}*/
11
+
12
+public class PaymentSortByPayer implements Comparable<Payment> {
13
+    Payment payment1;
14
+    Payment payment2;
15
+    public PaymentSortByPayer() {
16
+    }
17
+
18
+    public PaymentSortByPayer(Payment payment1, Payment payment2) {
19
+        this.payment1 = payment1;
20
+        this.payment2 = payment2;
21
+    }
22
+    public PaymentSortByPayer(Payment payment1) {
23
+        this.payment1 = payment1;
24
+    }
25
+
26
+    @Override
27
+    public int compareTo(Payment o) {
28
+        return payment1.getShortDescription().compareTo(o.getShortDescription());
29
+    }
30
+
31
+    public int compare(Payment payment1, Payment payment2) {
32
+        return payment1.getShortDescription().compareTo(payment2.getShortDescription());
33
+    }
34
+
35
+    public int compare() {
36
+        return this.payment1.getShortDescription().compareTo(this.payment2.getShortDescription());
37
+    }
38
+}

+ 108
- 0
src/test/java/com/zipcoder/payment/CheckTest.java Просмотреть файл

@@ -0,0 +1,108 @@
1
+package com.zipcoder.payment;
2
+
3
+import org.junit.Test;
4
+import org.junit.Assert;
5
+
6
+public class CheckTest
7
+{
8
+    Check check =  new Check();
9
+    long testId = 11;
10
+    String testPayerName = "Tia Mowry";
11
+    String testRoutingNumber = "121";
12
+    String testAccountNumber = "134344551";
13
+
14
+    @Test
15
+    public void setId0() {
16
+        Assert.assertEquals(0, check.getId());
17
+    }
18
+
19
+    @Test
20
+    public void setId() {
21
+        check.setId(testId);
22
+        Assert.assertEquals(testId, check.getId());
23
+    }
24
+
25
+    @Test
26
+    public void getId() {
27
+        check.setId(testId);
28
+
29
+        long expected = testId;
30
+        long actual = check.getId();
31
+
32
+        Assert.assertEquals(expected, actual);
33
+    }
34
+
35
+    @Test
36
+    public void setPayerName0() {
37
+        Assert.assertNull(check.getPayerName());
38
+    }
39
+
40
+    @Test
41
+    public void setPayerName() {
42
+        check.setPayerName(testPayerName);
43
+        Assert.assertNotNull(check.getPayerName());
44
+    }
45
+
46
+    @Test
47
+    public void getRoutingNumber() {
48
+        check.setRoutingNumber(testRoutingNumber);
49
+
50
+        String expected = testRoutingNumber;
51
+        String actual = check.getRoutingNumber();
52
+
53
+        Assert.assertEquals(expected,actual);
54
+    }
55
+
56
+    @Test
57
+    public void setRoutingNumber0() {
58
+        Assert.assertNull(check.getRoutingNumber());
59
+    }
60
+
61
+    @Test
62
+    public void setRoutingNumber() {
63
+        check.setRoutingNumber(testRoutingNumber);
64
+        Assert.assertNotNull(check.getRoutingNumber());
65
+    }
66
+
67
+    @Test
68
+    public void getAccountNumber() {
69
+        check.setAccountNumber(testAccountNumber);
70
+
71
+        String expected = testAccountNumber;
72
+        String actual = check.getAccountNumber();
73
+
74
+        Assert.assertEquals(expected,actual);
75
+    }
76
+
77
+    @Test
78
+    public void setAccountNumber0() {
79
+        Assert.assertNull(check.getRoutingNumber());
80
+    }
81
+
82
+    @Test
83
+    public void setAccountNumber() {
84
+        check.setAccountNumber(testAccountNumber);
85
+        Assert.assertNotNull(check.getAccountNumber());
86
+    }
87
+
88
+    @Test
89
+    public void getPayerName() {
90
+        check.setPayerName(testPayerName);
91
+
92
+        String expected = testPayerName;
93
+        String actual = check.getPayerName();
94
+
95
+        Assert.assertEquals(expected,actual);
96
+    }
97
+
98
+    @Test
99
+    public void getShortDescription() {
100
+        check.setPayerName(testPayerName);
101
+        check.setAccountNumber(testAccountNumber);
102
+
103
+        String expected = "Check Tia Mowry ***4551";
104
+        String actual = check.getShortDescription();
105
+
106
+        Assert.assertEquals(expected,actual);
107
+    }
108
+}

+ 35
- 0
src/test/java/com/zipcoder/payment/ComparableTest.java Просмотреть файл

@@ -0,0 +1,35 @@
1
+package com.zipcoder.payment;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class ComparableTest
7
+{
8
+    @Test
9
+    public void compareToTest() {
10
+        PayPal payPal = new PayPal(0, "Tia Mowry", "tia@mowry.com");
11
+        Check check = new Check(0, "Tia Mowry", "11432543", "134344551");
12
+
13
+        Assert.assertTrue(payPal.compareTo(check) > 0);
14
+    }
15
+
16
+    @Test
17
+    public void compareToTest1() {
18
+        PaymentSortByPayer payment1 = new PaymentSortByPayer(new PayPal(0, "Tia Mowry", "tia@mowry.com"));
19
+        Check payment2 = new Check(0, "Tia Mowry", "11432543", "134344551");
20
+
21
+        Assert.assertTrue(payment1.compareTo(payment2) > 0);
22
+    }
23
+
24
+    @Test
25
+    public void compareToTest2() {
26
+        PaymentSortByPayer payments = new PaymentSortByPayer(
27
+                new PayPal(0, "Tia Mowry", "tia@mowry.com"),
28
+                new Check(0, "Tia Mowry", "11432543", "134344551")
29
+        );
30
+
31
+        int paymentComparison = payments.compare();
32
+
33
+        Assert.assertTrue(paymentComparison > 0);
34
+    }
35
+}

+ 137
- 0
src/test/java/com/zipcoder/payment/CreditCardTest.java Просмотреть файл

@@ -0,0 +1,137 @@
1
+package com.zipcoder.payment;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class CreditCardTest
7
+{
8
+    CreditCard creditCard = new CreditCard();
9
+    long testId = 11;
10
+    String testName = "Tia Mowry";
11
+    String testNumber = "134344551";
12
+    int testExpiredMonth = 10;
13
+    int testExpiredYear = 2019;
14
+
15
+
16
+    @Test
17
+    public void setId0() {
18
+        Assert.assertEquals( 0, creditCard.getId());
19
+    }
20
+
21
+    @Test
22
+    public void setId1() {
23
+        creditCard.setId(testId);
24
+
25
+        Assert.assertNotNull(creditCard.getId());
26
+    }
27
+
28
+    @Test
29
+    public void getId() {
30
+        creditCard.setId(testId);
31
+
32
+        long actual = creditCard.getId();
33
+        long expected = testId;
34
+
35
+        Assert.assertEquals(expected,actual);
36
+    }
37
+
38
+    @Test
39
+    public void setPayerName0() {
40
+        Assert.assertNull(creditCard.getPayerName());
41
+    }
42
+
43
+    @Test
44
+    public void setPayerName() {
45
+        creditCard.setPayerName(testName);
46
+        Assert.assertNotNull(creditCard.getPayerName());
47
+    }
48
+
49
+    @Test
50
+    public void getPayerName() {
51
+        creditCard.setPayerName(testName);
52
+
53
+        String expected = testName;
54
+        String actual = creditCard.getPayerName();
55
+
56
+        Assert.assertEquals(expected, actual);
57
+    }
58
+
59
+    @Test
60
+    public void getNumber() {
61
+        creditCard.setNumber(testNumber);
62
+
63
+        String expected = testNumber;
64
+        String actual = creditCard.getNumber();
65
+
66
+        Assert.assertEquals(expected,actual);
67
+    }
68
+
69
+    @Test
70
+    public void setNumber() {
71
+        creditCard.setNumber(testNumber);
72
+
73
+        Assert.assertNotNull(creditCard.getNumber());
74
+    }
75
+
76
+    @Test
77
+    public void setNumber0() {
78
+        Assert.assertNull(creditCard.getNumber());
79
+    }
80
+
81
+    @Test
82
+    public void getExpiredMonth() {
83
+        creditCard.setExpiredMonth(testExpiredMonth);
84
+
85
+        int expected = testExpiredMonth;
86
+        int actual = creditCard.getExpiredMonth();
87
+
88
+        Assert.assertEquals(expected,actual);
89
+    }
90
+
91
+    @Test
92
+    public void setExpiredMonth0() {
93
+        Assert.assertEquals(0,creditCard.getExpiredMonth());
94
+    }
95
+
96
+    @Test
97
+    public void setExpiredMonth() {
98
+        creditCard.setExpiredMonth(testExpiredMonth);
99
+
100
+        Assert.assertEquals(testExpiredMonth,creditCard.getExpiredMonth());
101
+    }
102
+
103
+    @Test
104
+    public void getExpiredYear() {
105
+        creditCard.setExpiredYear(testExpiredYear);
106
+
107
+        int expected = testExpiredYear;
108
+        int actual = creditCard.getExpiredYear();
109
+
110
+        Assert.assertEquals(expected,actual);
111
+    }
112
+
113
+    @Test
114
+    public void setExpiredYear0() {
115
+        Assert.assertEquals(0, creditCard.getExpiredYear());
116
+    }
117
+
118
+    @Test
119
+    public void setExpiredYear() {
120
+        creditCard.setExpiredYear(testExpiredYear);
121
+        Assert.assertEquals(testExpiredYear,creditCard.getExpiredYear());
122
+    }
123
+
124
+    @Test
125
+    public void getShortDescription() {
126
+        creditCard.setId(testId);
127
+        creditCard.setPayerName(testName);
128
+        creditCard.setNumber(testNumber);
129
+        creditCard.setExpiredMonth(testExpiredMonth);
130
+        creditCard.setExpiredYear(testExpiredYear);
131
+
132
+        String expected = "CC Tia Mowry 4551 10/2019";
133
+        String actual = creditCard.getShortDescription();
134
+
135
+        Assert.assertEquals(expected,actual);
136
+    }
137
+}

+ 87
- 0
src/test/java/com/zipcoder/payment/PayPalTest.java Просмотреть файл

@@ -0,0 +1,87 @@
1
+package com.zipcoder.payment;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class PayPalTest {
7
+    PayPal payPal = new PayPal();
8
+    long testId = 11;
9
+    String testPayerName = "Tia Mowry";
10
+    String testEmail = "tia@mowry.com";
11
+
12
+    @Test
13
+    public void setId0() {
14
+        Assert.assertEquals(0, payPal.getId());
15
+    }
16
+
17
+    @Test
18
+    public void setId() {
19
+        payPal.setId(testId);
20
+        Assert.assertEquals(testId, payPal.getId());
21
+    }
22
+
23
+    @Test
24
+    public void getId() {
25
+        payPal.setId(testId);
26
+
27
+        long expected = testId;
28
+        long actual = payPal.getId();
29
+
30
+        Assert.assertEquals(expected, actual);
31
+    }
32
+
33
+    @Test
34
+    public void setPayerName0() {
35
+        Assert.assertNull(payPal.getPayerName());
36
+    }
37
+
38
+
39
+    @Test
40
+    public void setPayerName() {
41
+        payPal.setPayerName(testPayerName);
42
+        Assert.assertNotNull(payPal.getPayerName());
43
+    }
44
+
45
+    @Test
46
+    public void getPayerName() {
47
+        payPal.setPayerName(testPayerName);
48
+
49
+        String expected = testPayerName;
50
+        String actual = payPal.getPayerName();
51
+
52
+        Assert.assertEquals(expected,actual);
53
+    }
54
+
55
+    @Test
56
+    public void setEmail0() {
57
+        Assert.assertNull(payPal.getEmail());
58
+    }
59
+
60
+
61
+    @Test
62
+    public void setEmail() {
63
+        payPal.setEmail(testEmail);
64
+        Assert.assertNotNull(payPal.getEmail());
65
+    }
66
+
67
+    @Test
68
+    public void getEmail() {
69
+        payPal.setEmail(testEmail);
70
+
71
+        String expected = testEmail;
72
+        String actual = payPal.getEmail();
73
+
74
+        Assert.assertEquals(expected,actual);
75
+    }
76
+
77
+    @Test
78
+    public void getShortDescription() {
79
+        payPal.setPayerName(testPayerName);
80
+        payPal.setEmail(testEmail);
81
+
82
+        String expected = "Paypal Tia Mowry tia@mowry.com";
83
+        String actual = payPal.getShortDescription();
84
+
85
+        Assert.assertEquals(expected,actual);
86
+    }
87
+}

+ 65
- 1
src/test/java/com/zipcoder/payment/PaymentPresenterTest.java Просмотреть файл

@@ -1,4 +1,68 @@
1 1
 package com.zipcoder.payment;
2 2
 
3
-public class PaymentPresenterTest {
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+public class PaymentPresenterTest
7
+{
8
+    @Test
9
+    public void toStringNoPayment() {
10
+        Payment[] payments = new Payment[0];
11
+        PaymentPresenter presenter = new PaymentPresenter();
12
+        String expected = "";
13
+
14
+        String actual = presenter.toString(payments);
15
+
16
+        Assert.assertEquals(expected, actual);
17
+    }
18
+
19
+    @Test
20
+    public void toStringMultiplePayments () {
21
+        Payment[] payments = new Payment[2];
22
+        Payment paypal = new PayPal(4L, "Tia Mowry", "tia@mowry.com");
23
+        Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
24
+
25
+        payments[0] = paypal;
26
+        payments[1] = check;
27
+
28
+        PaymentPresenter presenter = new PaymentPresenter();
29
+        String expected = "Check Tia Mowry ***4551\nPaypal Tia Mowry tia@mowry.com\n";
30
+
31
+        String actual = presenter.toString(payments);
32
+
33
+        Assert.assertEquals(expected, actual);
34
+    }
35
+
36
+    @Test
37
+    public void toStringByPayerName() {
38
+        Payment[] payments = new Payment[2];
39
+        Payment paypal = new PayPal(4L, "Tamara Mowry", "tamara@mowry.com");
40
+        Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
41
+
42
+        payments[0] = paypal;
43
+        payments[1] = check;
44
+
45
+        PaymentPresenter presenter = new PaymentPresenter();
46
+        String expected = "Check Tia Mowry ***4551\nPaypal Tamara Mowry tamara@mowry.com\n";
47
+
48
+        String actual = presenter.toStringByPayerName(payments);
49
+        Assert.assertEquals(expected, actual);
50
+    }
51
+
52
+    @Test
53
+    public void toStringById() {
54
+        Payment[] payments = new Payment[2];
55
+        Payment paypal = new PayPal(120L, "Tamara Mowry", "tamara@mowry.com");
56
+        Payment check = new Check(81L, "Tia Mowry", "11432543", "134344551");
57
+
58
+        payments[0] = paypal;
59
+        payments[1] = check;
60
+
61
+        PaymentPresenter presenter = new PaymentPresenter();
62
+        String expected = "Check Tia Mowry ***4551\nPaypal Tamara Mowry tamara@mowry.com\n";
63
+
64
+        String actual = presenter.toStringById(payments);
65
+        Assert.assertEquals(expected, actual);
66
+    }
67
+
4 68
 }