CapybaraTest.java 710B

123456789101112131415161718192021222324252627282930313233343536373839
  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 CapybaraTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class CapybaraTest
  12. {
  13. Capybara rocky;
  14. @Before
  15. public void setup(){
  16. rocky = new Capybara("Rocky Pal-boa");
  17. }
  18. @Test
  19. public void speak() {
  20. String expected = "???";
  21. String actual = rocky.speak();
  22. Assert.assertEquals(expected, actual);
  23. }
  24. @Test
  25. public void name() {
  26. String expected = "Rocky Pal-boa";
  27. String actual = rocky.getName();
  28. Assert.assertEquals(expected, actual);
  29. }
  30. }