12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import static org.junit.Assert.*;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. /**
  6. * The test class DogTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class DogTest
  12. {
  13. private Dog dog;
  14. /**
  15. * Default constructor for test class DogTest
  16. */
  17. public DogTest()
  18. {
  19. }
  20. /**
  21. * Sets up the test fixture.
  22. *
  23. * Called before every test case method.
  24. */
  25. @Before
  26. public void setUp()
  27. {
  28. dog = new Dog("fido");
  29. }
  30. /**
  31. * Tears down the test fixture.
  32. *
  33. * Called after every test case method.
  34. */
  35. @After
  36. public void tearDown()
  37. {
  38. }
  39. @Test
  40. public void dogTest(){
  41. String expected = "woof";
  42. String actual = dog.speak();
  43. assertEquals(expected , actual);
  44. }
  45. }