|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+package com.zipcoder.payment;
|
|
|
2
|
+
|
|
|
3
|
+import org.junit.Assert;
|
|
|
4
|
+import org.junit.Test;
|
|
|
5
|
+
|
|
|
6
|
+public class PayPalTest {
|
|
|
7
|
+
|
|
|
8
|
+ //Given
|
|
|
9
|
+ PayPal customer = new PayPal(1L, "Lauren Green", "lauren@mail.com");
|
|
|
10
|
+ PayPal customer2 = new PayPal(2L, "Hayden Stewart", "hayden@mail.com");
|
|
|
11
|
+
|
|
|
12
|
+ @Test
|
|
|
13
|
+ public void testId() {
|
|
|
14
|
+ //When
|
|
|
15
|
+ Long expected = 3L;
|
|
|
16
|
+ customer.setId(3L);
|
|
|
17
|
+ Long actual = customer.getId();
|
|
|
18
|
+
|
|
|
19
|
+ //Then
|
|
|
20
|
+ Assert.assertEquals(expected, actual);
|
|
|
21
|
+
|
|
|
22
|
+ }
|
|
|
23
|
+
|
|
|
24
|
+ @Test
|
|
|
25
|
+ public void testName() {
|
|
|
26
|
+ //When
|
|
|
27
|
+ String expected = "Lauren Stewart";
|
|
|
28
|
+ customer.setPayerName("Lauren Stewart");
|
|
|
29
|
+ String actual = customer.getPayerName();
|
|
|
30
|
+
|
|
|
31
|
+ //Then
|
|
|
32
|
+ Assert.assertEquals(expected, actual);
|
|
|
33
|
+
|
|
|
34
|
+ }
|
|
|
35
|
+
|
|
|
36
|
+ @Test
|
|
|
37
|
+ public void testEmail() {
|
|
|
38
|
+ //When
|
|
|
39
|
+ String expected = "lgreen@mail.com";
|
|
|
40
|
+ customer.setEmail("lgreen@mail.com");
|
|
|
41
|
+ String actual = customer.getEmail();
|
|
|
42
|
+
|
|
|
43
|
+ //Then
|
|
|
44
|
+ Assert.assertEquals(expected, actual);
|
|
|
45
|
+
|
|
|
46
|
+ }
|
|
|
47
|
+
|
|
|
48
|
+
|
|
|
49
|
+ @Test
|
|
|
50
|
+ public void testShortDescription() {
|
|
|
51
|
+ //When
|
|
|
52
|
+ String expected = "PayPal Hayden Stewart hayden@mail.com";
|
|
|
53
|
+ String actual = customer2.getShortDescription();
|
|
|
54
|
+
|
|
|
55
|
+ //Then
|
|
|
56
|
+ Assert.assertEquals(expected, actual);
|
|
|
57
|
+
|
|
|
58
|
+ }
|
|
|
59
|
+
|
|
|
60
|
+}
|