|
@@ -1,2 +1,65 @@
|
|
1
|
+import org.junit.Assert;
|
|
2
|
+import org.junit.Test;
|
|
3
|
+
|
1
|
4
|
public class FizzBuzzTest {
|
|
5
|
+
|
|
6
|
+ @Test
|
|
7
|
+ public void FizzBuzzTest1(){
|
|
8
|
+ //given
|
|
9
|
+ FizzBuzz buzz = new FizzBuzz();
|
|
10
|
+ int inputNumber = 9;
|
|
11
|
+ String expectedOutput = "Fizz";
|
|
12
|
+
|
|
13
|
+ //when
|
|
14
|
+ String actualOutput = buzz.of(inputNumber);
|
|
15
|
+
|
|
16
|
+ //then
|
|
17
|
+ Assert.assertEquals(expectedOutput, actualOutput);
|
|
18
|
+
|
|
19
|
+ }
|
|
20
|
+
|
|
21
|
+ @Test
|
|
22
|
+ public void FizzBuzzTest2(){
|
|
23
|
+ //given
|
|
24
|
+ FizzBuzz buzz = new FizzBuzz();
|
|
25
|
+ int inputNumber = 10;
|
|
26
|
+ String expectedOutput = "Buzz";
|
|
27
|
+
|
|
28
|
+ //when
|
|
29
|
+ String actualOutput = buzz.of(inputNumber);
|
|
30
|
+
|
|
31
|
+ //then
|
|
32
|
+ Assert.assertEquals(expectedOutput, actualOutput);
|
|
33
|
+
|
|
34
|
+ }
|
|
35
|
+
|
|
36
|
+ @Test
|
|
37
|
+ public void FizzBuzzTest3(){
|
|
38
|
+ //given
|
|
39
|
+ FizzBuzz buzz = new FizzBuzz();
|
|
40
|
+ int inputNumber = 15;
|
|
41
|
+ String expectedOutput = "FizzBuzz";
|
|
42
|
+
|
|
43
|
+ //when
|
|
44
|
+ String actualOutput = buzz.of(inputNumber);
|
|
45
|
+
|
|
46
|
+ //then
|
|
47
|
+ Assert.assertEquals(expectedOutput, actualOutput);
|
|
48
|
+
|
|
49
|
+ }
|
|
50
|
+
|
|
51
|
+ @Test
|
|
52
|
+ public void FizzBuzzTest4(){
|
|
53
|
+ //given
|
|
54
|
+ FizzBuzz buzz = new FizzBuzz();
|
|
55
|
+ int inputNumber = 2;
|
|
56
|
+ String expectedOutput = "2";
|
|
57
|
+
|
|
58
|
+ //when
|
|
59
|
+ String actualOutput = buzz.of(inputNumber);
|
|
60
|
+
|
|
61
|
+ //then
|
|
62
|
+ Assert.assertEquals(expectedOutput, actualOutput);
|
|
63
|
+
|
|
64
|
+ }
|
2
|
65
|
}
|