|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+package com.zipcoder.payment;
|
|
|
2
|
+
|
|
|
3
|
+import org.junit.Test;
|
|
|
4
|
+
|
|
|
5
|
+import static org.junit.Assert.*;
|
|
|
6
|
+
|
|
|
7
|
+public class CreditCardTest {
|
|
|
8
|
+
|
|
|
9
|
+ @Test
|
|
|
10
|
+ public void getID() {
|
|
|
11
|
+ //creditCard object
|
|
|
12
|
+ CreditCard cc = new CreditCard();
|
|
|
13
|
+ //long ID we are testing
|
|
|
14
|
+
|
|
|
15
|
+ //Given
|
|
|
16
|
+ long ExpectedID = 1234567891;
|
|
|
17
|
+ //When
|
|
|
18
|
+ cc.setID(ExpectedID);
|
|
|
19
|
+ //Then
|
|
|
20
|
+ long actualID = cc.getID();
|
|
|
21
|
+ assertEquals(ExpectedID,actualID);
|
|
|
22
|
+ }
|
|
|
23
|
+
|
|
|
24
|
+ @Test
|
|
|
25
|
+ public void getPayerName() {
|
|
|
26
|
+ //creditCard object
|
|
|
27
|
+ CreditCard cc = new CreditCard();
|
|
|
28
|
+ //long ID we are testing
|
|
|
29
|
+
|
|
|
30
|
+ //Given
|
|
|
31
|
+ String ExpectedPayerName = "Tia Mowry";
|
|
|
32
|
+ //When
|
|
|
33
|
+ cc.setPayerName(ExpectedPayerName);
|
|
|
34
|
+ //Then
|
|
|
35
|
+ String actualID = cc.getPayerName();
|
|
|
36
|
+ assertEquals(ExpectedPayerName,actualID);
|
|
|
37
|
+ }
|
|
|
38
|
+
|
|
|
39
|
+ @Test
|
|
|
40
|
+ public void getExpiredMonth(){
|
|
|
41
|
+ int expiredMonth = 10;
|
|
|
42
|
+ //creditCard object
|
|
|
43
|
+ CreditCard cc = new CreditCard();
|
|
|
44
|
+ //long ID we are testing
|
|
|
45
|
+
|
|
|
46
|
+ //Given
|
|
|
47
|
+ int expectedExpiredMonth = expiredMonth;
|
|
|
48
|
+ //When
|
|
|
49
|
+ cc.setExpiredMonth(expiredMonth);
|
|
|
50
|
+ //Then
|
|
|
51
|
+ int actualExpiredMonth = cc.getExpiredMonth();
|
|
|
52
|
+ assertEquals(expectedExpiredMonth,actualExpiredMonth);
|
|
|
53
|
+ }
|
|
|
54
|
+ @Test
|
|
|
55
|
+ public void getExpiredYear(){
|
|
|
56
|
+ //creditCard object
|
|
|
57
|
+ CreditCard cc = new CreditCard();
|
|
|
58
|
+ //long ID we are testing
|
|
|
59
|
+
|
|
|
60
|
+ //Given
|
|
|
61
|
+ int ExpectedExpireYear = 2019;
|
|
|
62
|
+ //When
|
|
|
63
|
+ cc.setExpiredYear(ExpectedExpireYear);
|
|
|
64
|
+ //Then
|
|
|
65
|
+ int actualExpiredYear = cc.getExpiredYear();
|
|
|
66
|
+ assertEquals(ExpectedExpireYear,actualExpiredYear);
|
|
|
67
|
+ }
|
|
|
68
|
+ @Test
|
|
|
69
|
+ public void getShortDescription() {
|
|
|
70
|
+
|
|
|
71
|
+ }
|
|
|
72
|
+}
|