12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class FizzBuzzTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class FizzBuzzTest
- {
- @Test
- public void testFive() {
- Integer input = 5;
- FizzBuzz fb = new FizzBuzz(input);
-
- boolean fizz = fb.getFizz();
- boolean buzz = fb.getBuzz();
- boolean fizzBuzz = fb.getFizzBuzz();
-
- assertFalse(fizz); // multiple of 3
- assertTrue(buzz); // multiple of 5
- assertFalse(fizzBuzz); // multiple of 15
- }
-
- @Test
- public void testThree() {
- Integer input = 3;
- FizzBuzz fb = new FizzBuzz(input);
-
- boolean fizz = fb.getFizz();
- boolean buzz = fb.getBuzz();
- boolean fizzBuzz = fb.getFizzBuzz();
-
- assertTrue(fizz); // multiple of 3
- assertFalse(buzz); // multiple of 5
- assertFalse(fizzBuzz); // multiple of 15
- }
-
- @Test
- public void testTen() {
- Integer input = 10;
- FizzBuzz fb = new FizzBuzz(input);
-
- boolean fizz = fb.getFizz();
- boolean buzz = fb.getBuzz();
- boolean fizzBuzz = fb.getFizzBuzz();
-
- assertFalse(fizz); // multiple of 3
- assertTrue(buzz); // multiple of 5
- assertFalse(fizzBuzz); // multiple of 15
- }
-
- @Test
- public void testSix() {
- Integer input = 6;
- FizzBuzz fb = new FizzBuzz(input);
-
- boolean fizz = fb.getFizz();
- boolean buzz = fb.getBuzz();
- boolean fizzBuzz = fb.getFizzBuzz();
-
- assertTrue(fizz); // multiple of 3
- assertFalse(buzz); // multiple of 5
- assertFalse(fizzBuzz); // multiple of 15
- }
-
- @Test
- public void testFifteen() {
- Integer input = 15;
- FizzBuzz fb = new FizzBuzz(input);
-
- boolean fizz = fb.getFizz();
- boolean buzz = fb.getBuzz();
- boolean fizzBuzz = fb.getFizzBuzz();
-
- assertTrue(fizz); // multiple of 3
- assertTrue(buzz); // multiple of 5
- assertTrue(fizzBuzz); // multiple of 15
- }
- }
|