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));
    }
}

@@ -362,214 +362,82 @@
 ber_
-is_times_of_first_special_number() %7B%0A        // given%0A        Integer three = 3;%0A        Integer nine = 9;%0A%0A        // when%0A%0A        // then%0A        assertThat(fizzBuzzWhizz.answer(three)).isEqualTo(%22Fizz%22)
+comform_the_FizzRule() %7B%0A        Integer number = FizzRule.DIVISOR_OF_FIZZ
 ;%0A  
@@ -479,11 +479,13 @@
 er(n
-ine
+umber
 )).i
@@ -497,210 +497,71 @@
 lTo(
-%22
 Fizz
-%22);%0A    %7D%0A%0A    @Test%0A    public void should_return_the_same_number_if_number_is_not_the_times_of_first_special_number() %7B%0A        //given%0A        Integer number = 4;%0A%0A        //when%0A%0A        //then
+Rule.FIZZ);%0A%0A        number = FizzRule.DIVISOR_OF_FIZZ * 2;
 %0A   
@@ -620,30 +620,21 @@
 lTo(
-String.valueOf(number)
+FizzRule.FIZZ
 );%0A 
@@ -698,214 +698,82 @@
 ber_
-is_times_of_the_second_special_number() %7B%0A        //given%0A        Integer five = 5;%0A        Integer ten = 10;%0A%0A        //when%0A%0A        //then%0A        assertThat(fizzBuzzWhizz.answer(five)).isEqualTo(%22Buzz%22)
+comform_the_BuzzRule() %7B%0A        Integer number = BuzzRule.DIVISOR_OF_BUZZ
 ;%0A  
@@ -814,11 +814,14 @@
 wer(
-ten
+number
 )).i
@@ -833,212 +833,71 @@
 lTo(
-%22
 Buzz
-%22);%0A    %7D%0A%0A    @Test%0A    public void should_return_the_same_number_if_number_is_not_the_times_of_the_second_special_number() %7B%0A        //given%0A        Integer two = 2;%0A%0A        //when%0A%0A        //then
+Rule.BUZZ);%0A%0A        number = BuzzRule.DIVISOR_OF_BUZZ * 2;
 %0A   
@@ -933,19 +933,22 @@
 .answer(
-two
+number
 )).isEqu
@@ -956,27 +956,21 @@
 lTo(
-String.valueOf(two)
+BuzzRule.BUZZ
 );%0A 
@@ -1035,154 +1035,86 @@
 ber_
-is_times_of
+comform
 _the_
-third_special_number() %7B%0A        //given%0A        Integer seven = 7;%0A        Integer fourteen = 14;%0A%0A        //when%0A%0A        //then
+WhizzRule() %7B%0A        Integer number = WhizzRule.DIVISOR_OF_WHIZZ;
 %0A   
@@ -1154,13 +1154,14 @@
 wer(
-seven
+number
 )).i
@@ -1165,32 +1165,90 @@
 ).isEqualTo(
-%22
 Whizz
-%22)
+Rule.WHIZZ);%0A%0A        number = WhizzRule.DIVISOR_OF_WHIZZ * 2
 ;%0A        as
@@ -1281,16 +1281,14 @@
 wer(
-fourteen
+number
 )).i
@@ -1300,18 +1300,27 @@
 lTo(
-%22
 Whizz
-%22
+Rule.WHIZZ
 );%0A
+%0A
     
@@ -1366,16 +1366,14 @@
 urn_
-the_same
+origin
 _num
@@ -1390,83 +1390,27 @@
 ber_
-is_not_the_times_of_the_third_special_number() %7B%0A        Integer eight = 8;
+no_comform_Rule() %7B
 %0A   
@@ -1446,21 +1446,17 @@
 .answer(
-eight
+2
 )).isEqu
@@ -1464,32 +1464,15 @@
 lTo(
-String.valueOf(eight)
+%222%22
 );%0A
+%0A
     

update FizzBuzzWhizzTest.java