|
@@ -0,0 +1,88 @@
|
|
1
|
+import java.util.*;
|
|
2
|
+import org.junit.After;
|
|
3
|
+import org.junit.Before;
|
|
4
|
+import org.junit.Test;
|
|
5
|
+import org.junit.Assert;
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+/**
|
|
9
|
+ * The test class FizzBuzzTest.
|
|
10
|
+ *
|
|
11
|
+ * @author (your name)
|
|
12
|
+ * @version (a version number or a date)
|
|
13
|
+ */
|
|
14
|
+public class FizzBuzzTest
|
|
15
|
+{
|
|
16
|
+ @Test
|
|
17
|
+ public void testFizz1(){
|
|
18
|
+ Integer input = 3;
|
|
19
|
+
|
|
20
|
+ FizzBuzz fizzBuzz = new FizzBuzz(input);
|
|
21
|
+ String expected = "Fizz";
|
|
22
|
+ String actual = fizzBuzz.fizz();
|
|
23
|
+
|
|
24
|
+ Assert.assertEquals(expected, actual);
|
|
25
|
+ }
|
|
26
|
+
|
|
27
|
+ @Test
|
|
28
|
+ public void testFizz2(){
|
|
29
|
+ Integer input = 9;
|
|
30
|
+
|
|
31
|
+ FizzBuzz fizzBuzz = new FizzBuzz(input);
|
|
32
|
+ String expected = "Fizz";
|
|
33
|
+ String actual = fizzBuzz.fizz();
|
|
34
|
+
|
|
35
|
+ Assert.assertEquals(expected, actual);
|
|
36
|
+ }
|
|
37
|
+
|
|
38
|
+ @Test
|
|
39
|
+ public void testBuzz1(){
|
|
40
|
+ Integer input = 5;
|
|
41
|
+
|
|
42
|
+ FizzBuzz fizzBuzz = new FizzBuzz(input);
|
|
43
|
+ String expected = "Buzz";
|
|
44
|
+ String actual = fizzBuzz.buzz();
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+ Assert.assertEquals(expected, actual);
|
|
48
|
+ }
|
|
49
|
+
|
|
50
|
+ @Test
|
|
51
|
+ public void testBuzz2(){
|
|
52
|
+ Integer input = 10;
|
|
53
|
+
|
|
54
|
+ FizzBuzz fizzBuzz = new FizzBuzz(input);
|
|
55
|
+ String expected = "Buzz";
|
|
56
|
+ String actual = fizzBuzz.buzz();
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+ Assert.assertEquals(expected, actual);
|
|
60
|
+ }
|
|
61
|
+
|
|
62
|
+ @Test
|
|
63
|
+ public void testFizzBuzz1(){
|
|
64
|
+ Integer input = 15;
|
|
65
|
+
|
|
66
|
+ FizzBuzz fizzBuzz = new FizzBuzz(input);
|
|
67
|
+ String expected = "FizzBuzz";
|
|
68
|
+ String actual = fizzBuzz.fizzBuzz();
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+ Assert.assertEquals(expected, actual);
|
|
72
|
+
|
|
73
|
+ }
|
|
74
|
+
|
|
75
|
+ @Test
|
|
76
|
+ public void testFizzBuzz2(){
|
|
77
|
+ Integer input = 30;
|
|
78
|
+
|
|
79
|
+ FizzBuzz fizzBuzz = new FizzBuzz(input);
|
|
80
|
+ String expected = "FizzBuzz";
|
|
81
|
+ String actual = fizzBuzz.fizzBuzz();
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+ Assert.assertEquals(expected, actual);
|
|
85
|
+
|
|
86
|
+ }
|
|
87
|
+
|
|
88
|
+}
|