| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- package com.zipcoder.payment;
-
- import org.junit.Test;
- import org.junit.Assert;
-
- public class CheckTest {
-
- Check check1 = new Check(111000, "Michelle", "12345", "67789");
-
- @Test
- public void idSetGet(){
- long expectedOutput = 11110000;
-
- check1.setId(11110000);
- long actualOutput = check1.getId();
-
- Assert.assertEquals(expectedOutput, actualOutput);
-
- }
-
-
- @Test
- public void payerNameSetGet(){
- String expectedOutput = "Michelle";
-
- check1.setPayerName("Michelle");
- String actualOutput = check1.getPayerName();
-
- Assert.assertEquals(expectedOutput, actualOutput);
-
-
- }
-
- @Test
- public void routingSetGet(){
- String expectedOutput = "1234567";
-
- check1.setRoutingNumber("1234567");
- String actualOutput = check1.getRoutingNumber();
-
- Assert.assertEquals(expectedOutput, actualOutput);
-
- }
-
- @Test
- public void accountSetGet(){
- String expectedOutput = "78910";
-
- check1.setAccountNumber("78910");
- String actualOutput = check1.getAccountNumber();
-
- Assert.assertEquals(expectedOutput, actualOutput);
- }
-
- @Test
- public void getShortDescTest(){
- check1.setPayerName("Michelle");
- check1.setAccountNumber("78910");
-
- String expectedOutput = "Check Michelle ***78910";
-
- String actualOutput = check1.getShortDescription();
-
- Assert.assertEquals(expectedOutput, actualOutput);
- }
-
- @Test
- public void compare2Test() {
- CreditCard cc2 = new CreditCard(2233, "Michelle", "12345", 12, 18);
- Check check2 = new Check(22233, "Michelle", "123456", "1234567");
-
- int expectedOutput = 0;
- int actualOutput = check2.getShortDescription().compareTo(cc2.getShortDescription());
-
- Assert.assertTrue(expectedOutput < actualOutput);
- }
-
-
- }
|