| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package com.zipcoder.payment;
-
- import org.junit.Test;
-
- import static junit.framework.TestCase.assertEquals;
- import static junit.framework.TestCase.assertTrue;
-
- public class PayPalTest {
-
- @Test
- public void testGetter(){
- long expected = 1;
- PayPal payPal = new PayPal(3, "kevin", "K@yahoo.com");
- payPal.setId(1);
- long actual = payPal.getId();
- assertEquals(expected, actual);
- }
- @Test
- public void testPayerName(){
- String expected = "Marie";
- PayPal payPal = new PayPal(2, "Marie", "m@yahoo.com");
- payPal.setPayerName("Marie");
- String actual = payPal.getPayerName();
- assertEquals(expected, actual);
- }
- @Test
- public void testEmail(){
- String expected = "abs@yahoo.com";
- PayPal payPal = new PayPal(1, "john", "j@yahoo.com");
- payPal.setEmail("abs@yahoo.com");
- String actual = payPal.getEmail();
- assertEquals(expected, actual);
- }
- @Test
- public void testCompareToGreaterThan(){
- int expected = 0;
- Payment payPal = new PayPal(4, "Tia Mowry", "tia@mowry.com");
- Payment check = new Check(6, "Tia Mowry", "2323", "4556");
- int actual = payPal.compareTo(check);
- assertTrue(actual > expected);
- }
- @Test
- public void testCompareToEqual(){
- int expected = 0;
- Payment payPal = new PayPal(7, "Matt", "m@yahoo.com");
- Payment payPal2 = new PayPal(7, "Matt", "m@yahoo.com");
- int actual = payPal.compareTo(payPal2);
- assertTrue(actual == expected);
- }
- @Test
- public void testCompareToLessThan(){
- int expected = 0;
- Payment payPal = new PayPal(3, "Kay", "k@yahoo.com");
- Payment check = new Check(2, "Leo", "55666", "5678");
- int actual = payPal.compareTo(check);
- }
-
- }
|