| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package com.zipcoder.payment;
-
- import org.junit.Assert;
- import org.junit.Before;
- import org.junit.Test;
-
- public class CheckTest {
- private Check testCheck;
- private CreditCard cc;
-
- @Before
- public void setUp() {
- testCheck = new Check();
-
- testCheck.setId(12345678910L);
- testCheck.setPayerName("Biggie");
- testCheck.setRoutingNumber("623852453");
- testCheck.setAccountNumber("1234567");
-
- cc = new CreditCard();
- cc.setPayerName("Apple");
- cc.setNumber("4567 8910 9090 9000");
- }
-
- @Test
- public void testId() {
- Long expectedId = 12345678910L;
- testCheck.setId(12345678910L);
- Assert.assertEquals(expectedId, testCheck.getId());
- }
-
- @Test
- public void testPayerName() {
- String expectedName = "Biggie";
- Assert.assertEquals(expectedName, testCheck.getPayerName());
-
- }
-
- @Test
- public void testAccountingNum() {
- String expectedActNum = "1234567";
- Assert.assertEquals(expectedActNum, testCheck.getAccountNumber());
- }
-
- @Test
- public void testRoutingNum() {
- String expectedRout = "623852453";
- Assert.assertEquals(expectedRout, testCheck.getRoutingNumber());
- }
-
- @Test
- public void testShortDesc() {
- String expectedDesc = "Check Biggie ***4567";
- Assert.assertEquals(expectedDesc, testCheck.getShortDescription());
- }
-
- @Test
- public void testCompareTo() {
- int expectedComp = 37;
- Assert.assertEquals(expectedComp, testCheck.compareTo(cc));
- }
- }
|