| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package com.zipcoder.payment;
-
- import org.junit.Assert;
- import org.junit.Test;
-
- public class PayPalTest {
-
- @Test
- public void idGetterSetterTest(){
- PayPal payPal = new PayPal();
- payPal.setId(12345L);
-
- Long expected = 12345L;
-
- Assert.assertEquals(expected, payPal.getID());
- }
-
- @Test
- public void payerNameGetterSetterTest(){
- PayPal payPal = new PayPal();
- payPal.setPayerName("John Jacob");
-
- String expected = "John Jacob";
-
- Assert.assertEquals(expected, payPal.getPayerName());
- }
-
- @Test
- public void emailGetterSetterTest(){
- PayPal payPal = new PayPal();
- payPal.setEmail("John.Jacob@fakeemail.com");
-
- String expected = "John.Jacob@fakeemail.com";
-
- Assert.assertEquals(expected, payPal.getEmail());
- }
-
- @Test
- public void getShortDescriptionTest(){
- PayPal payPal = new PayPal("John Jacob", "john.jacob@fakeemail.com");
-
- String expected = "Paypal John Jacob john.jacob@fakeemail.com";
-
- Assert.assertEquals(expected, payPal.getShortDescription());
- }
-
- @Test
- public void compareToDifferentPayPalTest(){
- PayPal payPal = new PayPal();
- PayPal payPal1 = new PayPal();
-
- Assert.assertTrue(payPal.compareTo(payPal1) == 0);
- }
-
- @Test
- public void compareToCCPayPalTest(){
- CreditCard creditCard = new CreditCard("John Jacob", "1234567890123456", 12, 2018);
- PayPal payPal = new PayPal();
-
- Assert.assertTrue(payPal.compareTo(creditCard) > 0);
- }
- }
|