123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. @Test
  14. public void fizz(){
  15. FizzBuzz fb = new FizzBuzz();
  16. String actual = fb.of(3);
  17. String expected = "Fizz";
  18. assertEquals(expected, actual);
  19. }
  20. @Test
  21. public void buzz(){
  22. FizzBuzz fb = new FizzBuzz();
  23. String actual = fb.of(5);
  24. String expected = "Buzz";
  25. assertEquals(expected, actual);
  26. }
  27. @Test
  28. public void FizzBuzz(){
  29. FizzBuzz fb = new FizzBuzz();
  30. String actual = fb.of(15);
  31. String expected = "FizzBuzz";
  32. assertEquals(expected, actual);
  33. }
  34. @Test
  35. public void noFizzBuzz(){
  36. FizzBuzz fb = new FizzBuzz();
  37. String actual = fb.of(13);
  38. String expected = "13";
  39. assertEquals(expected, actual);
  40. }
  41. }