|
@@ -1,2 +1,72 @@
|
|
1
|
+import org.junit.Assert;
|
|
2
|
+import org.junit.Test;
|
|
3
|
+
|
1
|
4
|
public class FizzBuzzTest {
|
|
5
|
+ @Test
|
|
6
|
+ public void FizzBuzz1() {
|
|
7
|
+
|
|
8
|
+ //Given
|
|
9
|
+ FizzBuzz buzz = new FizzBuzz();
|
|
10
|
+ int x = 12;
|
|
11
|
+ String expected = "Fizz";
|
|
12
|
+ //When
|
|
13
|
+ String actual = FizzBuzz.divisible(x);
|
|
14
|
+ Assert.assertEquals(expected,actual);
|
|
15
|
+ }
|
|
16
|
+ @Test
|
|
17
|
+ public void FizzBuzzThree() {
|
|
18
|
+
|
|
19
|
+ //Given
|
|
20
|
+ FizzBuzz buzz = new FizzBuzz();
|
|
21
|
+ int x = 2;
|
|
22
|
+ String expected = "2";
|
|
23
|
+ //When
|
|
24
|
+ String actual = FizzBuzz.divisible(x);
|
|
25
|
+ Assert.assertEquals(expected,actual);
|
|
26
|
+ }
|
|
27
|
+ @Test
|
|
28
|
+ public void FizzBuzz2() {
|
|
29
|
+
|
|
30
|
+ //Given
|
|
31
|
+ FizzBuzz buzz1 = new FizzBuzz();
|
|
32
|
+ int x = 20;
|
|
33
|
+ String expected = "Buzz";
|
|
34
|
+ //When
|
|
35
|
+ String actual = FizzBuzz.divisible1(x);
|
|
36
|
+ Assert.assertEquals(expected,actual);
|
|
37
|
+ }
|
|
38
|
+ @Test
|
|
39
|
+ public void FizzBuzzFour() {
|
|
40
|
+
|
|
41
|
+ //Given
|
|
42
|
+ FizzBuzz buzz1 = new FizzBuzz();
|
|
43
|
+ int x = 3;
|
|
44
|
+ String expected = "3";
|
|
45
|
+ //When
|
|
46
|
+ String actual = FizzBuzz.divisible1(x);
|
|
47
|
+ Assert.assertEquals(expected,actual);
|
|
48
|
+ }
|
|
49
|
+
|
|
50
|
+ @ Test
|
|
51
|
+ public void FizzBuzz3 (){
|
|
52
|
+
|
|
53
|
+ //Given
|
|
54
|
+ FizzBuzz buzz2 = new FizzBuzz();
|
|
55
|
+ int x = 30;
|
|
56
|
+ String expected = "FizzBuzz";
|
|
57
|
+ //when
|
|
58
|
+ String actual = FizzBuzz.divisible2(x);
|
|
59
|
+ Assert.assertEquals(expected, actual);
|
|
60
|
+ }
|
|
61
|
+ @ Test
|
|
62
|
+ public void FizzBuzzFive (){
|
|
63
|
+
|
|
64
|
+ //Given
|
|
65
|
+ FizzBuzz buzz3 = new FizzBuzz();
|
|
66
|
+ int x = 8;
|
|
67
|
+ String expected = "8";
|
|
68
|
+ //when
|
|
69
|
+ String actual = FizzBuzz.divisible2(x);
|
|
70
|
+ Assert.assertEquals(expected, actual);
|
|
71
|
+ }
|
2
|
72
|
}
|