package com.thoughtworks.btu;

import org.junit.Before;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class FizzBuzzWhizzTest {

    private FizzBuzzWhizz fizzBuzzWhizz;

    @Before
    public void setUp() {
        this.fizzBuzzWhizz = new FizzBuzzWhizz();
    }

    @Test
    public void should_return_Fizz_if_number_is_times_of_first_special_number() {
        // given
        Integer three = 3;
        Integer nine = 9;

        // when

        // then
        assertThat(fizzBuzzWhizz.answer(three)).isEqualTo("Fizz");
        assertThat(fizzBuzzWhizz.answer(nine)).isEqualTo("Fizz");
    }

    @Test
    public void should_return_the_same_number_if_number_is_not_the_times_of_first_special_number() {
        //given
        Integer number = 4;

        //when

        //then
        assertThat(fizzBuzzWhizz.answer(number)).isEqualTo(String.valueOf(number));
    }

    @Test
    public void should_return_Buzz_if_number_is_times_of_the_second_special_number() {
        //given
        Integer five = 5;
        Integer ten = 10;

        //when

        //then
        assertThat(fizzBuzzWhizz.answer(five)).isEqualTo("Buzz");
        assertThat(fizzBuzzWhizz.answer(ten)).isEqualTo("Buzz");
    }

    @Test
    public void should_return_the_same_number_if_number_is_not_the_times_of_the_second_special_number() {
        //given
        Integer two = 2;

        //when

        //then
        assertThat(fizzBuzzWhizz.answer(two)).isEqualTo(String.valueOf(two));
    }

    @Test
    public void should_return_Whizz_if_number_is_times_of_the_third_special_number() {
        //given
        Integer seven = 7;
        Integer fourteen = 14;

        //when

        //then
        assertThat(fizzBuzzWhizz.answer(seven)).isEqualTo("Whizz");
        assertThat(fizzBuzzWhizz.answer(fourteen)).isEqualTo("Whizz");
    }

    @Test
    public void should_return_the_same_number_if_number_is_not_the_times_of_the_third_special_number() {
        Integer eight = 8;
        assertThat(fizzBuzzWhizz.answer(eight)).isEqualTo(String.valueOf(eight));
    }
}

package com.thoughtworks.btu;

import org.junit.Before;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class FizzBuzzWhizzTest {

    private FizzBuzzWhizz fizzBuzzWhizz;

    @Before
    public void setUp() {
        this.fizzBuzzWhizz = new FizzBuzzWhizz();
    }

    @Test
    public void should_return_Fizz_if_number_comform_the_FizzRule() {
        Integer number = FizzRule.DIVISOR_OF_FIZZ;
        assertThat(fizzBuzzWhizz.answer(number)).isEqualTo(FizzRule.FIZZ);

        number = FizzRule.DIVISOR_OF_FIZZ * 2;
        assertThat(fizzBuzzWhizz.answer(number)).isEqualTo(FizzRule.FIZZ);
    }

    @Test
    public void should_return_Buzz_if_number_comform_the_BuzzRule() {
        Integer number = BuzzRule.DIVISOR_OF_BUZZ;
        assertThat(fizzBuzzWhizz.answer(number)).isEqualTo(BuzzRule.BUZZ);

        number = BuzzRule.DIVISOR_OF_BUZZ * 2;
        assertThat(fizzBuzzWhizz.answer(number)).isEqualTo(BuzzRule.BUZZ);
    }

    @Test
    public void should_return_Whizz_if_number_comform_the_WhizzRule() {
        Integer number = WhizzRule.DIVISOR_OF_WHIZZ;
        assertThat(fizzBuzzWhizz.answer(number)).isEqualTo(WhizzRule.WHIZZ);

        number = WhizzRule.DIVISOR_OF_WHIZZ * 2;
        assertThat(fizzBuzzWhizz.answer(number)).isEqualTo(WhizzRule.WHIZZ);

    }

    @Test
    public void should_return_origin_number_if_number_no_comform_Rule() {
        assertThat(fizzBuzzWhizz.answer(2)).isEqualTo("2");

    }
}

update FizzBuzzWhizzTest.java