瀏覽代碼

removed final keyword from test (#1438)

Scott Ertel 6 年之前
父節點
當前提交
ebd47c44ed
共有 1 個文件被更改,包括 36 次插入36 次删除
  1. 36
    36
      exercises/minesweeper/src/test/java/MinesweeperBoardTest.java

+ 36
- 36
exercises/minesweeper/src/test/java/MinesweeperBoardTest.java 查看文件

11
 
11
 
12
     @Test
12
     @Test
13
     public void testInputBoardWithNoRowsAndNoColumns() {
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
18
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
19
     }
19
     }
21
     @Ignore("Remove to run test")
21
     @Ignore("Remove to run test")
22
     @Test
22
     @Test
23
     public void testInputBoardWithOneRowAndNoColumns() {
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
28
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
29
     }
29
     }
31
     @Ignore("Remove to run test")
31
     @Ignore("Remove to run test")
32
     @Test
32
     @Test
33
     public void testInputBoardWithNoMines() {
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
48
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
49
     }
49
     }
51
     @Ignore("Remove to run test")
51
     @Ignore("Remove to run test")
52
     @Test
52
     @Test
53
     public void testInputBoardWithOnlyMines() {
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
68
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
69
     }
69
     }
71
     @Ignore("Remove to run test")
71
     @Ignore("Remove to run test")
72
     @Test
72
     @Test
73
     public void testInputBoardWithSingleMineAtCenter() {
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
                 "111",
81
                 "111",
82
                 "1*1",
82
                 "1*1",
83
                 "111"
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
88
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
89
     }
89
     }
91
     @Ignore("Remove to run test")
91
     @Ignore("Remove to run test")
92
     @Test
92
     @Test
93
     public void testInputBoardWithMinesAroundPerimeter() {
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
                 "*8*",
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
108
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
109
     }
109
     }
111
     @Ignore("Remove to run test")
111
     @Ignore("Remove to run test")
112
     @Test
112
     @Test
113
     public void testInputBoardWithSingleRowAndTwoMines() {
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
                 "1*2*1"
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
124
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
125
     }
125
     }
127
     @Ignore("Remove to run test")
127
     @Ignore("Remove to run test")
128
     @Test
128
     @Test
129
     public void testInputBoardWithSingleRowAndTwoMinesAtEdges() {
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
                 "*1 1*"
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
140
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
141
     }
141
     }
143
     @Ignore("Remove to run test")
143
     @Ignore("Remove to run test")
144
     @Test
144
     @Test
145
     public void testInputBoardWithSingleColumnAndTwoMines() {
145
     public void testInputBoardWithSingleColumnAndTwoMines() {
146
-        final List<String> inputBoard = Arrays.asList(
146
+        List<String> inputBoard = Arrays.asList(
147
                 " ",
147
                 " ",
148
                 "*",
148
                 "*",
149
                 " ",
149
                 " ",
151
                 " "
151
                 " "
152
         );
152
         );
153
 
153
 
154
-        final List<String> expectedNumberedBoard = Arrays.asList(
154
+        List<String> expectedNumberedBoard = Arrays.asList(
155
                 "1",
155
                 "1",
156
                 "*",
156
                 "*",
157
                 "2",
157
                 "2",
159
                 "1"
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
164
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
165
     }
165
     }
167
     @Ignore("Remove to run test")
167
     @Ignore("Remove to run test")
168
     @Test
168
     @Test
169
     public void testInputBoardWithSingleColumnAndTwoMinesAtEdges() {
169
     public void testInputBoardWithSingleColumnAndTwoMinesAtEdges() {
170
-        final List<String> inputBoard = Arrays.asList(
170
+        List<String> inputBoard = Arrays.asList(
171
                 "*",
171
                 "*",
172
                 " ",
172
                 " ",
173
                 " ",
173
                 " ",
175
                 "*"
175
                 "*"
176
         );
176
         );
177
 
177
 
178
-        final List<String> expectedNumberedBoard = Arrays.asList(
178
+        List<String> expectedNumberedBoard = Arrays.asList(
179
                 "*",
179
                 "*",
180
                 "1",
180
                 "1",
181
                 " ",
181
                 " ",
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
188
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
189
     }
189
     }
191
     @Ignore("Remove to run test")
191
     @Ignore("Remove to run test")
192
     @Test
192
     @Test
193
     public void testInputBoardWithMinesInCross() {
193
     public void testInputBoardWithMinesInCross() {
194
-        final List<String> inputBoard = Arrays.asList(
194
+        List<String> inputBoard = Arrays.asList(
195
                 "  *  ",
195
                 "  *  ",
196
                 "  *  ",
196
                 "  *  ",
197
                 "*****",
197
                 "*****",
199
                 "  *  "
199
                 "  *  "
200
         );
200
         );
201
 
201
 
202
-        final List<String> expectedNumberedBoard = Arrays.asList(
202
+        List<String> expectedNumberedBoard = Arrays.asList(
203
                 " 2*2 ",
203
                 " 2*2 ",
204
                 "25*52",
204
                 "25*52",
205
                 "*****",
205
                 "*****",
207
                 " 2*2 "
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
212
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
213
     }
213
     }
215
     @Ignore("Remove to run test")
215
     @Ignore("Remove to run test")
216
     @Test
216
     @Test
217
     public void testLargeInputBoard() {
217
     public void testLargeInputBoard() {
218
-        final List<String> inputBoard = Arrays.asList(
218
+        List<String> inputBoard = Arrays.asList(
219
                 " *  * ",
219
                 " *  * ",
220
                 "  *   ",
220
                 "  *   ",
221
                 "    * ",
221
                 "    * ",
224
                 "      "
224
                 "      "
225
         );
225
         );
226
 
226
 
227
-        final List<String> expectedNumberedBoard = Arrays.asList(
227
+        List<String> expectedNumberedBoard = Arrays.asList(
228
                 "1*22*1",
228
                 "1*22*1",
229
                 "12*322",
229
                 "12*322",
230
                 " 123*2",
230
                 " 123*2",
233
                 "111111"
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
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
238
         assertEquals(expectedNumberedBoard, actualNumberedBoard);
239
     }
239
     }