|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+package com.zipcoder.payment;
|
|
|
2
|
+
|
|
|
3
|
+import org.junit.Assert;
|
|
|
4
|
+import org.junit.Before;
|
|
|
5
|
+import org.junit.Test;
|
|
|
6
|
+
|
|
|
7
|
+public class PayPalTest {
|
|
|
8
|
+ PayPal testPal;
|
|
|
9
|
+
|
|
|
10
|
+
|
|
|
11
|
+ @Before
|
|
|
12
|
+ public void initialization() {
|
|
|
13
|
+ testPal = new PayPal(15,"Momo Hashimoto", "kawaii54@line.com");
|
|
|
14
|
+
|
|
|
15
|
+ }
|
|
|
16
|
+ @Test
|
|
|
17
|
+ public void getSetIdTest() {
|
|
|
18
|
+ long expected = 100;
|
|
|
19
|
+ testPal.setId(100);
|
|
|
20
|
+ long actual = testPal.getId();
|
|
|
21
|
+
|
|
|
22
|
+ Assert.assertEquals(expected, actual);
|
|
|
23
|
+
|
|
|
24
|
+ }
|
|
|
25
|
+
|
|
|
26
|
+ @Test
|
|
|
27
|
+ public void getSetPayerNameTest() {
|
|
|
28
|
+ String expected = "Sara";
|
|
|
29
|
+ testPal.setPayerName("Sara");
|
|
|
30
|
+
|
|
|
31
|
+ String actual = testPal.getPayerName();
|
|
|
32
|
+
|
|
|
33
|
+ Assert.assertEquals(expected, actual);
|
|
|
34
|
+ }
|
|
|
35
|
+
|
|
|
36
|
+ @Test
|
|
|
37
|
+ public void getSetEmail() {
|
|
|
38
|
+ String expected = "godot@gmail.com";
|
|
|
39
|
+ testPal.setEmail("godot@gmail.com");
|
|
|
40
|
+
|
|
|
41
|
+ String actual = testPal.getEmail();
|
|
|
42
|
+
|
|
|
43
|
+ Assert.assertEquals(expected, actual);
|
|
|
44
|
+ }
|
|
|
45
|
+}
|