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. /**
  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. {
  16. FizzBuzz fizzbuzz = new FizzBuzz();
  17. assertEquals("Fizz", fizzbuzz.FizzBuzz(3));
  18. assertEquals("Fizz", fizzbuzz.FizzBuzz(6));
  19. assertEquals("Fizz", fizzbuzz.FizzBuzz(9));
  20. }
  21. @Test
  22. public void Buzz()
  23. {
  24. FizzBuzz fizzbuzz = new FizzBuzz();
  25. assertEquals("Buzz", fizzbuzz.FizzBuzz(5));
  26. assertEquals("Buzz", fizzbuzz.FizzBuzz(10));
  27. assertEquals("Buzz", fizzbuzz.FizzBuzz(25));
  28. }
  29. @Test
  30. public void FizzBuzz()
  31. {
  32. FizzBuzz fizzbuzz = new FizzBuzz();
  33. assertEquals("FizzBuzz", fizzbuzz.FizzBuzz(15));
  34. assertEquals("FizzBuzz", fizzbuzz.FizzBuzz(30));
  35. assertEquals("FizzBuzz", fizzbuzz.FizzBuzz(60));
  36. }
  37. }