package com.zipcoder.payment; import org.junit.Test; import static org.junit.Assert.*; public class PaypalTest { @Test public void getSetId() { Paypal paypal = new Paypal(); long expected = 12345; paypal.setId(expected); long actual = paypal.getId(); assertEquals(expected, actual); } @Test public void getSetPayerName() { Paypal paypal = new Paypal(); String expected = "John Doe"; paypal.setPayerName(expected); String actual = paypal.getPayerName(); assertEquals(expected, actual); } @Test public void getSetEmail() { Paypal paypal = new Paypal(); String expected = "johndoe@alias.com"; paypal.setEmail(expected); String actual = paypal.getEmail(); assertEquals(expected, actual); } @Test public void getShortDescription() { Paypal paypal = new Paypal(); paypal.setPayerName("John Doe"); paypal.setEmail("johndoe@alias.com"); String expected = "Paypal John Doe johndoe@alias.com"; String actual = paypal.getShortDescription(); assertEquals(expected, actual); } @Test public void compareToCheckTest() { Paypal paypal = new Paypal(); paypal.setId(1); Check check = new Check(); check.setId(2); int actual = paypal.compareTo(check); int expected = -1; assertEquals(expected, actual); } @Test public void compareToCheckTest2() { Paypal paypal = new Paypal(); paypal.setId(1); Check check = new Check(); check.setId(1); int actual = paypal.compareTo(check); int expected = 0; assertEquals(expected, actual); } @Test public void compareToCreditCardTest() { Paypal paypal = new Paypal(); paypal.setId(1); CreditCard creditCard = new CreditCard(); creditCard.setId(0); int actual = paypal.compareTo(creditCard); int expected = 1; assertEquals(expected, actual); } }