12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 FizzBuzz.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class FizzBuzz {
  12. @Test
  13. public void testForFizz(){
  14. //When
  15. FizzBuzz1 fb = new FizzBuzz1();
  16. //Expected
  17. String equals = "Fizz";
  18. //Actual
  19. String actual = fb.Fizz(3);
  20. assertEquals(equals, actual);
  21. }
  22. @Test
  23. public void testForBuzz(){
  24. //When
  25. FizzBuzz1 fb = new FizzBuzz1();
  26. //Expected
  27. String equals = "Buzz";
  28. //Actual
  29. String actual = fb.Fizz(5);
  30. assertEquals(equals, actual);
  31. }
  32. @Test
  33. public void testForFizzBuzz(){
  34. //When
  35. FizzBuzz1 fb = new FizzBuzz1();
  36. //Expected
  37. String equals = "FizzBuzz";
  38. //Actual
  39. String actual = fb.Fizz(30);
  40. assertEquals(equals, actual);
  41. }
  42. @Test
  43. public void testForNeither(){
  44. //When
  45. FizzBuzz1 fb = new FizzBuzz1();
  46. //Expected
  47. String equals = "4";
  48. //Actual
  49. String actual = fb.Fizz(4);
  50. assertEquals(equals, actual);
  51. }
  52. }