PayPalTest.java 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import org.junit.Test;
  2. import static org.junit.Assert.*;
  3. public class PayPalTest {
  4. Check check = new Check();
  5. PayPal payPal = new PayPal(4L, "Tia Mowry", "tia@mowry.com");
  6. CreditCard credit = new CreditCard();
  7. @Test
  8. public void getPayerName() {
  9. PayPal payPal = new PayPal(4L, "Tia Mowry", "tia@mowry.com");
  10. String expectedPayerName = "Tia Mowry";
  11. payPal.setPayerName(expectedPayerName);
  12. String actualPayerName = payPal.getPayerName();
  13. assertEquals(expectedPayerName, actualPayerName);
  14. }
  15. @Test
  16. public void getEmail() {
  17. PayPal payPal = new PayPal(4L, "Tia Mowry", "tia@mowry.com");
  18. String expectedEmail = "tia@mowry.com";
  19. payPal.setEmail(expectedEmail);
  20. String actualEmail = payPal.getEmail();
  21. assertEquals(expectedEmail, actualEmail);
  22. }
  23. @Test
  24. public void getId() {
  25. }
  26. @Test
  27. public void getEmail1() {
  28. }
  29. @Test
  30. public void getShortDescription() {
  31. }
  32. @Test
  33. public void compareToCredit(){
  34. int expected = 0;
  35. int actual = credit.compareTo(credit);
  36. assertEquals(expected, actual);
  37. }
  38. @Test
  39. public void compareToPayPal(){
  40. int expected = 1;
  41. int actual = credit.compareTo(payPal);
  42. assertEquals(expected, actual);
  43. }
  44. @Test
  45. public void compareToCheck() {
  46. int expected = 1;
  47. int actual = credit.compareTo(check);
  48. assertEquals(expected, actual);
  49. }
  50. }