123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
-
-
- 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
- {
- /**
- * Default constructor for test class FizzBuzzTest
- */
- public FizzBuzzTest()
- {
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- */
- @Before
- public void setUp()
- {
- }
-
- @Test
- public void FizzTest() {
- String expected = "Fizz";
- FizzBuzz fb = new FizzBuzz();
- String actual = fb.of(3);
- assertEquals(expected, actual);
- }
-
- @Test
- public void BuzzTest() {
- String expected = "Buzz";
- FizzBuzz fb = new FizzBuzz();
- String actual = fb.of(5);
- assertEquals(expected, actual);
- }
-
- @Test
- public void FizzAndBuzzTest() {
- String expected = "FizzBuzz";
- FizzBuzz fb = new FizzBuzz();
- String actual = fb.of(15);
- assertEquals(expected, actual);
- }
-
- @Test
- public void ElseTest() {
- String expected = "2";
- FizzBuzz fb = new FizzBuzz();
- String actual = fb.of(2);
- assertEquals(expected, actual);
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- @After
- public void tearDown()
- {
- }
- }
|