PayPalTest.java 932B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.zipcoder.payment;
  2. import org.junit.Assert;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. public class PayPalTest {
  6. PayPal testPal;
  7. @Before
  8. public void initialization() {
  9. testPal = new PayPal(15,"Momo Hashimoto", "kawaii54@line.com");
  10. }
  11. @Test
  12. public void getSetIdTest() {
  13. long expected = 100;
  14. testPal.setId(100);
  15. long actual = testPal.getId();
  16. Assert.assertEquals(expected, actual);
  17. }
  18. @Test
  19. public void getSetPayerNameTest() {
  20. String expected = "Sara";
  21. testPal.setPayerName("Sara");
  22. String actual = testPal.getPayerName();
  23. Assert.assertEquals(expected, actual);
  24. }
  25. @Test
  26. public void getSetEmail() {
  27. String expected = "godot@gmail.com";
  28. testPal.setEmail("godot@gmail.com");
  29. String actual = testPal.getEmail();
  30. Assert.assertEquals(expected, actual);
  31. }
  32. }