FizzBuzzTest.java 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import static org.junit.Assert.*;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. public class FizzBuzzTest
  6. {
  7. @Test
  8. public void FizzBuzzTest1(){
  9. FizzBuzz fb = new FizzBuzz();
  10. String expected = "1";
  11. String actual = fb.fizzBuzz(1);
  12. assertEquals(expected, actual);
  13. }
  14. @Test
  15. public void FizzBuzzTest3(){
  16. FizzBuzz fb = new FizzBuzz();
  17. String expected = "fizz";
  18. String actual = fb.fizzBuzz(3);
  19. assertEquals(expected, actual);
  20. }
  21. @Test
  22. public void FizzBuzzTest5(){
  23. FizzBuzz fb = new FizzBuzz();
  24. String expected = "buzz";
  25. String actual = fb.fizzBuzz(5);
  26. assertEquals(expected, actual);
  27. }
  28. @Test
  29. public void FizzBuzzTest15(){
  30. FizzBuzz fb = new FizzBuzz();
  31. String expected = "fizzbuzz";
  32. String actual = fb.fizzBuzz(15);
  33. assertEquals(expected, actual);
  34. }
  35. }