|
@@ -11,9 +11,9 @@ public class MinesweeperBoardTest {
|
11
|
11
|
|
12
|
12
|
@Test
|
13
|
13
|
public void testInputBoardWithNoRowsAndNoColumns() {
|
14
|
|
- final List<String> inputBoard = Collections.emptyList();
|
15
|
|
- final List<String> expectedNumberedBoard = Collections.emptyList();
|
16
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
14
|
+ List<String> inputBoard = Collections.emptyList();
|
|
15
|
+ List<String> expectedNumberedBoard = Collections.emptyList();
|
|
16
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
17
|
17
|
|
18
|
18
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
19
|
19
|
}
|
|
@@ -21,9 +21,9 @@ public class MinesweeperBoardTest {
|
21
|
21
|
@Ignore("Remove to run test")
|
22
|
22
|
@Test
|
23
|
23
|
public void testInputBoardWithOneRowAndNoColumns() {
|
24
|
|
- final List<String> inputBoard = Collections.singletonList("");
|
25
|
|
- final List<String> expectedNumberedBoard = Collections.singletonList("");
|
26
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
24
|
+ List<String> inputBoard = Collections.singletonList("");
|
|
25
|
+ List<String> expectedNumberedBoard = Collections.singletonList("");
|
|
26
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
27
|
27
|
|
28
|
28
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
29
|
29
|
}
|
|
@@ -31,19 +31,19 @@ public class MinesweeperBoardTest {
|
31
|
31
|
@Ignore("Remove to run test")
|
32
|
32
|
@Test
|
33
|
33
|
public void testInputBoardWithNoMines() {
|
34
|
|
- final List<String> inputBoard = Arrays.asList(
|
|
34
|
+ List<String> inputBoard = Arrays.asList(
|
35
|
35
|
" ",
|
36
|
36
|
" ",
|
37
|
37
|
" "
|
38
|
38
|
);
|
39
|
39
|
|
40
|
|
- final List<String> expectedNumberedBoard = Arrays.asList(
|
|
40
|
+ List<String> expectedNumberedBoard = Arrays.asList(
|
41
|
41
|
" ",
|
42
|
42
|
" ",
|
43
|
43
|
" "
|
44
|
44
|
);
|
45
|
45
|
|
46
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
46
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
47
|
47
|
|
48
|
48
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
49
|
49
|
}
|
|
@@ -51,19 +51,19 @@ public class MinesweeperBoardTest {
|
51
|
51
|
@Ignore("Remove to run test")
|
52
|
52
|
@Test
|
53
|
53
|
public void testInputBoardWithOnlyMines() {
|
54
|
|
- final List<String> inputBoard = Arrays.asList(
|
|
54
|
+ List<String> inputBoard = Arrays.asList(
|
55
|
55
|
"***",
|
56
|
56
|
"***",
|
57
|
57
|
"***"
|
58
|
58
|
);
|
59
|
59
|
|
60
|
|
- final List<String> expectedNumberedBoard = Arrays.asList(
|
|
60
|
+ List<String> expectedNumberedBoard = Arrays.asList(
|
61
|
61
|
"***",
|
62
|
62
|
"***",
|
63
|
63
|
"***"
|
64
|
64
|
);
|
65
|
65
|
|
66
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
66
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
67
|
67
|
|
68
|
68
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
69
|
69
|
}
|
|
@@ -71,19 +71,19 @@ public class MinesweeperBoardTest {
|
71
|
71
|
@Ignore("Remove to run test")
|
72
|
72
|
@Test
|
73
|
73
|
public void testInputBoardWithSingleMineAtCenter() {
|
74
|
|
- final List<String> inputBoard = Arrays.asList(
|
|
74
|
+ List<String> inputBoard = Arrays.asList(
|
75
|
75
|
" ",
|
76
|
76
|
" * ",
|
77
|
77
|
" "
|
78
|
78
|
);
|
79
|
79
|
|
80
|
|
- final List<String> expectedNumberedBoard = Arrays.asList(
|
|
80
|
+ List<String> expectedNumberedBoard = Arrays.asList(
|
81
|
81
|
"111",
|
82
|
82
|
"1*1",
|
83
|
83
|
"111"
|
84
|
84
|
);
|
85
|
85
|
|
86
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
86
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
87
|
87
|
|
88
|
88
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
89
|
89
|
}
|
|
@@ -91,19 +91,19 @@ public class MinesweeperBoardTest {
|
91
|
91
|
@Ignore("Remove to run test")
|
92
|
92
|
@Test
|
93
|
93
|
public void testInputBoardWithMinesAroundPerimeter() {
|
94
|
|
- final List<String> inputBoard = Arrays.asList(
|
|
94
|
+ List<String> inputBoard = Arrays.asList(
|
95
|
95
|
"***",
|
96
|
96
|
"* *",
|
97
|
97
|
"***"
|
98
|
98
|
);
|
99
|
99
|
|
100
|
|
- final List<String> expectedNumberedBoard = Arrays.asList(
|
|
100
|
+ List<String> expectedNumberedBoard = Arrays.asList(
|
101
|
101
|
"***",
|
102
|
102
|
"*8*",
|
103
|
103
|
"***"
|
104
|
104
|
);
|
105
|
105
|
|
106
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
106
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
107
|
107
|
|
108
|
108
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
109
|
109
|
}
|
|
@@ -111,15 +111,15 @@ public class MinesweeperBoardTest {
|
111
|
111
|
@Ignore("Remove to run test")
|
112
|
112
|
@Test
|
113
|
113
|
public void testInputBoardWithSingleRowAndTwoMines() {
|
114
|
|
- final List<String> inputBoard = Collections.singletonList(
|
|
114
|
+ List<String> inputBoard = Collections.singletonList(
|
115
|
115
|
" * * "
|
116
|
116
|
);
|
117
|
117
|
|
118
|
|
- final List<String> expectedNumberedBoard = Collections.singletonList(
|
|
118
|
+ List<String> expectedNumberedBoard = Collections.singletonList(
|
119
|
119
|
"1*2*1"
|
120
|
120
|
);
|
121
|
121
|
|
122
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
122
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
123
|
123
|
|
124
|
124
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
125
|
125
|
}
|
|
@@ -127,15 +127,15 @@ public class MinesweeperBoardTest {
|
127
|
127
|
@Ignore("Remove to run test")
|
128
|
128
|
@Test
|
129
|
129
|
public void testInputBoardWithSingleRowAndTwoMinesAtEdges() {
|
130
|
|
- final List<String> inputBoard = Collections.singletonList(
|
|
130
|
+ List<String> inputBoard = Collections.singletonList(
|
131
|
131
|
"* *"
|
132
|
132
|
);
|
133
|
133
|
|
134
|
|
- final List<String> expectedNumberedBoard = Collections.singletonList(
|
|
134
|
+ List<String> expectedNumberedBoard = Collections.singletonList(
|
135
|
135
|
"*1 1*"
|
136
|
136
|
);
|
137
|
137
|
|
138
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
138
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
139
|
139
|
|
140
|
140
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
141
|
141
|
}
|
|
@@ -143,7 +143,7 @@ public class MinesweeperBoardTest {
|
143
|
143
|
@Ignore("Remove to run test")
|
144
|
144
|
@Test
|
145
|
145
|
public void testInputBoardWithSingleColumnAndTwoMines() {
|
146
|
|
- final List<String> inputBoard = Arrays.asList(
|
|
146
|
+ List<String> inputBoard = Arrays.asList(
|
147
|
147
|
" ",
|
148
|
148
|
"*",
|
149
|
149
|
" ",
|
|
@@ -151,7 +151,7 @@ public class MinesweeperBoardTest {
|
151
|
151
|
" "
|
152
|
152
|
);
|
153
|
153
|
|
154
|
|
- final List<String> expectedNumberedBoard = Arrays.asList(
|
|
154
|
+ List<String> expectedNumberedBoard = Arrays.asList(
|
155
|
155
|
"1",
|
156
|
156
|
"*",
|
157
|
157
|
"2",
|
|
@@ -159,7 +159,7 @@ public class MinesweeperBoardTest {
|
159
|
159
|
"1"
|
160
|
160
|
);
|
161
|
161
|
|
162
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
162
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
163
|
163
|
|
164
|
164
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
165
|
165
|
}
|
|
@@ -167,7 +167,7 @@ public class MinesweeperBoardTest {
|
167
|
167
|
@Ignore("Remove to run test")
|
168
|
168
|
@Test
|
169
|
169
|
public void testInputBoardWithSingleColumnAndTwoMinesAtEdges() {
|
170
|
|
- final List<String> inputBoard = Arrays.asList(
|
|
170
|
+ List<String> inputBoard = Arrays.asList(
|
171
|
171
|
"*",
|
172
|
172
|
" ",
|
173
|
173
|
" ",
|
|
@@ -175,7 +175,7 @@ public class MinesweeperBoardTest {
|
175
|
175
|
"*"
|
176
|
176
|
);
|
177
|
177
|
|
178
|
|
- final List<String> expectedNumberedBoard = Arrays.asList(
|
|
178
|
+ List<String> expectedNumberedBoard = Arrays.asList(
|
179
|
179
|
"*",
|
180
|
180
|
"1",
|
181
|
181
|
" ",
|
|
@@ -183,7 +183,7 @@ public class MinesweeperBoardTest {
|
183
|
183
|
"*"
|
184
|
184
|
);
|
185
|
185
|
|
186
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
186
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
187
|
187
|
|
188
|
188
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
189
|
189
|
}
|
|
@@ -191,7 +191,7 @@ public class MinesweeperBoardTest {
|
191
|
191
|
@Ignore("Remove to run test")
|
192
|
192
|
@Test
|
193
|
193
|
public void testInputBoardWithMinesInCross() {
|
194
|
|
- final List<String> inputBoard = Arrays.asList(
|
|
194
|
+ List<String> inputBoard = Arrays.asList(
|
195
|
195
|
" * ",
|
196
|
196
|
" * ",
|
197
|
197
|
"*****",
|
|
@@ -199,7 +199,7 @@ public class MinesweeperBoardTest {
|
199
|
199
|
" * "
|
200
|
200
|
);
|
201
|
201
|
|
202
|
|
- final List<String> expectedNumberedBoard = Arrays.asList(
|
|
202
|
+ List<String> expectedNumberedBoard = Arrays.asList(
|
203
|
203
|
" 2*2 ",
|
204
|
204
|
"25*52",
|
205
|
205
|
"*****",
|
|
@@ -207,7 +207,7 @@ public class MinesweeperBoardTest {
|
207
|
207
|
" 2*2 "
|
208
|
208
|
);
|
209
|
209
|
|
210
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
210
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
211
|
211
|
|
212
|
212
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
213
|
213
|
}
|
|
@@ -215,7 +215,7 @@ public class MinesweeperBoardTest {
|
215
|
215
|
@Ignore("Remove to run test")
|
216
|
216
|
@Test
|
217
|
217
|
public void testLargeInputBoard() {
|
218
|
|
- final List<String> inputBoard = Arrays.asList(
|
|
218
|
+ List<String> inputBoard = Arrays.asList(
|
219
|
219
|
" * * ",
|
220
|
220
|
" * ",
|
221
|
221
|
" * ",
|
|
@@ -224,7 +224,7 @@ public class MinesweeperBoardTest {
|
224
|
224
|
" "
|
225
|
225
|
);
|
226
|
226
|
|
227
|
|
- final List<String> expectedNumberedBoard = Arrays.asList(
|
|
227
|
+ List<String> expectedNumberedBoard = Arrays.asList(
|
228
|
228
|
"1*22*1",
|
229
|
229
|
"12*322",
|
230
|
230
|
" 123*2",
|
|
@@ -233,7 +233,7 @@ public class MinesweeperBoardTest {
|
233
|
233
|
"111111"
|
234
|
234
|
);
|
235
|
235
|
|
236
|
|
- final List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
|
236
|
+ List<String> actualNumberedBoard = new MinesweeperBoard(inputBoard).withNumbers();
|
237
|
237
|
|
238
|
238
|
assertEquals(expectedNumberedBoard, actualNumberedBoard);
|
239
|
239
|
}
|