FizzBuzzTest.java 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 FizzBuzzTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class FizzBuzzTest
  12. {
  13. FizzBuzz fizzBuzze = new FizzBuzz();
  14. @Test
  15. public void testFizzBuzz1(){
  16. String expected = "1";
  17. String actual = fizzBuzze.fizzBuzz(1);
  18. assertEquals(expected, actual);
  19. }
  20. @Test
  21. public void testFizzBuzz3(){
  22. String expected = "Fizz";
  23. String actual = fizzBuzze.fizzBuzz(3);
  24. assertEquals(expected, actual);
  25. }
  26. @Test
  27. public void testFizzBuzz5(){
  28. String expected = "Buzz";
  29. String actual = fizzBuzze.fizzBuzz(5);
  30. assertEquals(expected, actual);
  31. }
  32. @Test
  33. public void testFizzBuzz15(){
  34. String expected = "FizzBuzz";
  35. String actual = fizzBuzze.fizzBuzz(15);
  36. assertEquals(expected, actual);
  37. }
  38. }