12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import org.junit.Assert;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. /**
  6. * The test class PetTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class PetTest
  12. {
  13. @Test
  14. public void Dog() {
  15. Pet zero = new Dog("Special Agent Zero \"Skeleton Dog\" Growlkowski");
  16. String expected = "Special Agent Zero \"Skeleton Dog\" Growlkowski";
  17. String actual = zero.getName();
  18. Assert.assertEquals(expected, actual);
  19. }
  20. @Test
  21. public void Cat() {
  22. Pet boo = new Cat("Special Agent Zero \"Skeleton Dog\" Growlkowski");
  23. String expected = "Special Agent Zero \"Skeleton Dog\" Growlkowski";
  24. String actual = boo.getName();
  25. Assert.assertEquals(expected, actual);
  26. }
  27. @Test
  28. public void Capybara() {
  29. Pet rocky = new Capybara("Rocky Pal-boa");
  30. String expected = "Rocky Pal-boa";
  31. String actual = rocky.getName();
  32. Assert.assertEquals(expected, actual);
  33. }
  34. }