|
@@ -1,2 +1,44 @@
|
|
1
|
+import org.junit.Assert;
|
|
2
|
+import org.junit.Test;
|
|
3
|
+
|
1
|
4
|
public class FizzBuzzTest {
|
|
5
|
+
|
|
6
|
+ @Test
|
|
7
|
+ public void test1(){
|
|
8
|
+ //Given
|
|
9
|
+ FizzBuzz Fizz = new FizzBuzz();
|
|
10
|
+
|
|
11
|
+ int n = 12;
|
|
12
|
+
|
|
13
|
+ String expected = "Fizz";
|
|
14
|
+ //When
|
|
15
|
+ String acutal = Fizz.divideBy3(n);
|
|
16
|
+ Assert.assertEquals(expected,acutal);
|
|
17
|
+ }
|
|
18
|
+
|
|
19
|
+ @Test
|
|
20
|
+ public void test2(){
|
|
21
|
+ //Given
|
|
22
|
+ FizzBuzz Fizz = new FizzBuzz();
|
|
23
|
+
|
|
24
|
+ int n = 10;
|
|
25
|
+
|
|
26
|
+ String expected = "Buzz";
|
|
27
|
+ //When
|
|
28
|
+ String acutal = Fizz.divideBy5(n);
|
|
29
|
+ Assert.assertEquals(expected,acutal);
|
|
30
|
+ }
|
|
31
|
+
|
|
32
|
+ @Test
|
|
33
|
+ public void test3() {
|
|
34
|
+ //Given
|
|
35
|
+ FizzBuzz Fizz = new FizzBuzz();
|
|
36
|
+
|
|
37
|
+ int n = 15;
|
|
38
|
+
|
|
39
|
+ String expected = "FizzBuzz";
|
|
40
|
+ //When
|
|
41
|
+ String acutal = Fizz.divideBy15(n);
|
|
42
|
+ Assert.assertEquals(expected, acutal);
|
|
43
|
+ }
|
2
|
44
|
}
|