1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import java.util.*;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. import org.junit.Assert;
  6. /**
  7. * The test class FizzBuzzTest.
  8. *
  9. * @author (your name)
  10. * @version (a version number or a date)
  11. */
  12. public class FizzBuzzTest
  13. {
  14. @Test
  15. public void testFizz1(){
  16. Integer input = 3;
  17. FizzBuzz fizzBuzz = new FizzBuzz(input);
  18. String expected = "Fizz";
  19. String actual = fizzBuzz.fizz();
  20. Assert.assertEquals(expected, actual);
  21. }
  22. @Test
  23. public void testFizz2(){
  24. Integer input = 9;
  25. FizzBuzz fizzBuzz = new FizzBuzz(input);
  26. String expected = "Fizz";
  27. String actual = fizzBuzz.fizz();
  28. Assert.assertEquals(expected, actual);
  29. }
  30. @Test
  31. public void testBuzz1(){
  32. Integer input = 5;
  33. FizzBuzz fizzBuzz = new FizzBuzz(input);
  34. String expected = "Buzz";
  35. String actual = fizzBuzz.buzz();
  36. Assert.assertEquals(expected, actual);
  37. }
  38. @Test
  39. public void testBuzz2(){
  40. Integer input = 10;
  41. FizzBuzz fizzBuzz = new FizzBuzz(input);
  42. String expected = "Buzz";
  43. String actual = fizzBuzz.buzz();
  44. Assert.assertEquals(expected, actual);
  45. }
  46. @Test
  47. public void testFizzBuzz1(){
  48. Integer input = 15;
  49. FizzBuzz fizzBuzz = new FizzBuzz(input);
  50. String expected = "FizzBuzz";
  51. String actual = fizzBuzz.fizzBuzz();
  52. Assert.assertEquals(expected, actual);
  53. }
  54. @Test
  55. public void testFizzBuzz2(){
  56. Integer input = 30;
  57. FizzBuzz fizzBuzz = new FizzBuzz(input);
  58. String expected = "FizzBuzz";
  59. String actual = fizzBuzz.fizzBuzz();
  60. Assert.assertEquals(expected, actual);
  61. }
  62. }