| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- import org.junit.Test;
-
- import static org.junit.Assert.*;
-
-
-
-
- public class CreditCardTest {
-
-
- Check check = new Check();
- PayPal payPal = new PayPal(4L, "Tia Mowry", "tia@mowry.com");
- CreditCard credit = new CreditCard();
-
- @org.junit.Before
- public void setUp() throws Exception {
- }
-
- @org.junit.After
- public void tearDown() throws Exception {
- }
-
- @Test
- public void getId(){
- CreditCard credit = new CreditCard();
-
- long expectedId = 0;
-
- long actualId = credit.getId();
-
- assertEquals(expectedId, actualId);
-
- }
-
- @Test
- public void getPayerName(){
- CreditCard credit = new CreditCard();
-
- String expectedPayerName = "Tia Mowry";
- credit.setPayerName(expectedPayerName);
-
- String actualPayerName = credit.getPayerName();
-
- assertEquals(expectedPayerName, actualPayerName);
-
-
- }
-
- public void getShortDescription() {
- }
-
-
- @Test
- public void getNumber(){
- CreditCard credit = new CreditCard();
-
- String expectedNumber = "4551";
- credit.setNumber(expectedNumber);
- String actualNumber = credit.getNumber();
-
- assertEquals(expectedNumber, actualNumber);
-
- }
-
- @Test
- public void getExpiredMonth(){
- CreditCard credit = new CreditCard();
-
- int expectedExpiredMonth = 10;
- credit.setExpiredMonth(expectedExpiredMonth);
- int actualExpiredMonth = credit.getExpiredMonth();
-
- assertEquals(expectedExpiredMonth, actualExpiredMonth);
-
- }
-
-
- @Test
- public void getExpiredYear(){
- CreditCard credit = new CreditCard();
-
- int expectedExpiredYear = 2019;
- credit.setExpiredYear(expectedExpiredYear);
-
- int actualExpiredYear = credit.getexpiredYear();
-
- assertEquals(expectedExpiredYear, actualExpiredYear);
-
-
-
- }
- @Test
- public void compareToCredit(){
-
- int expected = 0;
-
- int actual = credit.compareTo(credit);
-
- assertEquals(expected, actual);
-
-
- }
- @Test
- public void compareToPayPal(){
-
-
-
- int expected = 1;
-
- int actual = credit.compareTo(payPal);
-
- assertEquals(expected, actual);
-
- }
- @Test
- public void compareToCheck() {
-
-
-
- int expected = 1;
-
- int actual = credit.compareTo(check);
-
- assertEquals(expected, actual);
- }
-
-
- }
|