Просмотр исходного кода

Standardize order of test annotations

Stuart Kent 9 лет назад
Родитель
Сommit
5d74edbf9d

+ 1
- 1
POLICIES.md Просмотреть файл

48
 
48
 
49
 ### Ignore noninitial tests
49
 ### Ignore noninitial tests
50
 
50
 
51
-> All but the first test in an exercise test suite should be annotated `@Ignore("Remove to run test")` (single test) or `@Ignore("Remove to run tests")` (parametrized test).
51
+> All but the first test in an exercise test suite should add `@Ignore("Remove to run test")` (single test) or `@Ignore("Remove to run tests")` (parametrized test) on the line before the corresponding `@Test` annotation.
52
 
52
 
53
 References: [[1](https://github.com/exercism/java/issues/101#issuecomment-249349204)]
53
 References: [[1](https://github.com/exercism/java/issues/101#issuecomment-249349204)]
54
 
54
 

+ 8
- 8
exercises/binary-search-tree/src/test/java/BSTTest.java Просмотреть файл

20
         assertEquals(expected, actual);
20
         assertEquals(expected, actual);
21
     }
21
     }
22
 
22
 
23
-    @Test
24
     @Ignore("Remove to run test")
23
     @Ignore("Remove to run test")
24
+    @Test
25
     public void insertsLess() {
25
     public void insertsLess() {
26
         BST<Integer> bst = new BST();
26
         BST<Integer> bst = new BST();
27
         final int expectedRoot = 4;
27
         final int expectedRoot = 4;
41
         assertEquals(expectedRoot, actualRoot);
41
         assertEquals(expectedRoot, actualRoot);
42
     }
42
     }
43
 
43
 
44
-    @Test
45
     @Ignore("Remove to run test")
44
     @Ignore("Remove to run test")
45
+    @Test
46
     public void insertsSame() {
46
     public void insertsSame() {
47
         BST<Integer> bst = new BST();
47
         BST<Integer> bst = new BST();
48
         final int expectedRoot = 4;
48
         final int expectedRoot = 4;
62
         assertEquals(expectedRoot, actualRoot);
62
         assertEquals(expectedRoot, actualRoot);
63
     }
63
     }
64
 
64
 
65
-    @Test
66
     @Ignore("Remove to run test")
65
     @Ignore("Remove to run test")
66
+    @Test
67
     public void insertsRight() {
67
     public void insertsRight() {
68
         BST<Integer> bst = new BST();
68
         BST<Integer> bst = new BST();
69
         final int expectedRoot = 4;
69
         final int expectedRoot = 4;
83
         assertEquals(expectedRoot, actualRoot);
83
         assertEquals(expectedRoot, actualRoot);
84
     }
84
     }
85
 
85
 
86
-    @Test
87
     @Ignore("Remove to run test")
86
     @Ignore("Remove to run test")
87
+    @Test
88
     public void createsComplexTree() {
88
     public void createsComplexTree() {
89
         BST<Integer> bst = new BST<>();
89
         BST<Integer> bst = new BST<>();
90
         List<Integer> expected = Collections.unmodifiableList(
90
         List<Integer> expected = Collections.unmodifiableList(
100
         assertEquals(expected, actual);
100
         assertEquals(expected, actual);
101
     }
101
     }
102
 
102
 
103
-    @Test
104
     @Ignore("Remove to run test")
103
     @Ignore("Remove to run test")
104
+    @Test
105
     public void sortsSingleElement() {
105
     public void sortsSingleElement() {
106
         BST<Integer> bst = new BST<>();
106
         BST<Integer> bst = new BST<>();
107
         List<Integer> expected = Collections.unmodifiableList(
107
         List<Integer> expected = Collections.unmodifiableList(
114
         assertEquals(expected, actual);
114
         assertEquals(expected, actual);
115
     }
115
     }
116
 
116
 
117
-    @Test
118
     @Ignore("Remove to run test")
117
     @Ignore("Remove to run test")
118
+    @Test
119
     public void sortsCollectionOfTwoIfSecondInsertedIsSmallerThanFirst() {
119
     public void sortsCollectionOfTwoIfSecondInsertedIsSmallerThanFirst() {
120
         BST<Integer> bst = new BST<>();
120
         BST<Integer> bst = new BST<>();
121
         List<Integer> expected = Collections.unmodifiableList(
121
         List<Integer> expected = Collections.unmodifiableList(
129
         assertEquals(expected, actual);
129
         assertEquals(expected, actual);
130
     }
130
     }
131
 
131
 
132
-    @Test
133
     @Ignore("Remove to run test")
132
     @Ignore("Remove to run test")
133
+    @Test
134
     public void sortsCollectionOfTwoIfSecondInsertedIsBiggerThanFirst() {
134
     public void sortsCollectionOfTwoIfSecondInsertedIsBiggerThanFirst() {
135
         BST<Integer> bst = new BST<>();
135
         BST<Integer> bst = new BST<>();
136
         List<Integer> expected = Collections.unmodifiableList(
136
         List<Integer> expected = Collections.unmodifiableList(
144
         assertEquals(expected, actual);
144
         assertEquals(expected, actual);
145
     }
145
     }
146
 
146
 
147
-    @Test
148
     @Ignore("Remove to run test")
147
     @Ignore("Remove to run test")
148
+    @Test
149
     public void iteratesOverComplexTree() {
149
     public void iteratesOverComplexTree() {
150
         BST<Integer> bst = new BST<>();
150
         BST<Integer> bst = new BST<>();
151
         List<Integer> expected = Collections.unmodifiableList(
151
         List<Integer> expected = Collections.unmodifiableList(

+ 36
- 36
exercises/custom-set/src/test/java/CustomSetTest.java Просмотреть файл

17
         assertTrue(actual);
17
         assertTrue(actual);
18
     }
18
     }
19
 
19
 
20
-    @Test
21
     @Ignore("Remove to run test")
20
     @Ignore("Remove to run test")
21
+    @Test
22
     public void setsWithElementsAreNotEmpty() {
22
     public void setsWithElementsAreNotEmpty() {
23
         final boolean actual
23
         final boolean actual
24
                 = new CustomSet<>(Arrays.asList(1))
24
                 = new CustomSet<>(Arrays.asList(1))
27
         assertFalse(actual);
27
         assertFalse(actual);
28
     }
28
     }
29
 
29
 
30
-    @Test
31
     @Ignore("Remove to run test")
30
     @Ignore("Remove to run test")
31
+    @Test
32
     public void nothingIsContainedInAnEmptySet() {
32
     public void nothingIsContainedInAnEmptySet() {
33
         final boolean actual
33
         final boolean actual
34
                 = new CustomSet<>(Collections.EMPTY_LIST)
34
                 = new CustomSet<>(Collections.EMPTY_LIST)
37
         assertFalse(actual);
37
         assertFalse(actual);
38
     }
38
     }
39
 
39
 
40
-    @Test
41
     @Ignore("Remove to run test")
40
     @Ignore("Remove to run test")
41
+    @Test
42
     public void whenTheElementIsInTheSet() {
42
     public void whenTheElementIsInTheSet() {
43
         final boolean actual
43
         final boolean actual
44
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
44
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
47
         assertTrue(actual);
47
         assertTrue(actual);
48
     }
48
     }
49
 
49
 
50
-    @Test
51
     @Ignore("Remove to run test")
50
     @Ignore("Remove to run test")
51
+    @Test
52
     public void whenTheElementIsNotInTheSet() {
52
     public void whenTheElementIsNotInTheSet() {
53
         final boolean actual
53
         final boolean actual
54
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
54
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
57
         assertFalse(actual);
57
         assertFalse(actual);
58
     }
58
     }
59
 
59
 
60
-    @Test
61
     @Ignore("Remove to run test")
60
     @Ignore("Remove to run test")
61
+    @Test
62
     public void emptySetIsASubsetOfAnotherEmptySet() {
62
     public void emptySetIsASubsetOfAnotherEmptySet() {
63
         final boolean actual
63
         final boolean actual
64
                 = new CustomSet<>(Collections.EMPTY_LIST)
64
                 = new CustomSet<>(Collections.EMPTY_LIST)
69
         assertTrue(actual);
69
         assertTrue(actual);
70
     }
70
     }
71
 
71
 
72
-    @Test
73
     @Ignore("Remove to run test")
72
     @Ignore("Remove to run test")
73
+    @Test
74
     public void emptySetIsASubsetOfNonEemptySet() {
74
     public void emptySetIsASubsetOfNonEemptySet() {
75
         final boolean actual
75
         final boolean actual
76
                 = new CustomSet<>(Arrays.asList(1))
76
                 = new CustomSet<>(Arrays.asList(1))
81
         assertTrue(actual);
81
         assertTrue(actual);
82
     }
82
     }
83
 
83
 
84
-    @Test
85
     @Ignore("Remove to run test")
84
     @Ignore("Remove to run test")
85
+    @Test
86
     public void nonEmptySetIsNotASubsetOfEmptySet() {
86
     public void nonEmptySetIsNotASubsetOfEmptySet() {
87
         final boolean actual
87
         final boolean actual
88
                 = new CustomSet<>(Collections.EMPTY_LIST)
88
                 = new CustomSet<>(Collections.EMPTY_LIST)
93
         assertFalse(actual);
93
         assertFalse(actual);
94
     }
94
     }
95
 
95
 
96
-    @Test
97
     @Ignore("Remove to run test")
96
     @Ignore("Remove to run test")
97
+    @Test
98
     public void setIsASubsetOfSetWithExactSameElements() {
98
     public void setIsASubsetOfSetWithExactSameElements() {
99
         final boolean actual
99
         final boolean actual
100
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
100
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
105
         assertTrue(actual);
105
         assertTrue(actual);
106
     }
106
     }
107
 
107
 
108
-    @Test
109
     @Ignore("Remove to run test")
108
     @Ignore("Remove to run test")
109
+    @Test
110
     public void setIsASubsetOfLargerSetWithSameElements() {
110
     public void setIsASubsetOfLargerSetWithSameElements() {
111
         final boolean actual
111
         final boolean actual
112
                 = new CustomSet<>(Arrays.asList(4, 1, 2, 3))
112
                 = new CustomSet<>(Arrays.asList(4, 1, 2, 3))
117
         assertTrue(actual);
117
         assertTrue(actual);
118
     }
118
     }
119
 
119
 
120
-    @Test
121
     @Ignore("Remove to run test")
120
     @Ignore("Remove to run test")
121
+    @Test
122
     public void setIsNotASubsetOfSetThatDoesNotContainItsElements() {
122
     public void setIsNotASubsetOfSetThatDoesNotContainItsElements() {
123
         final boolean actual
123
         final boolean actual
124
                 = new CustomSet<>(Arrays.asList(4, 1, 3))
124
                 = new CustomSet<>(Arrays.asList(4, 1, 3))
129
         assertFalse(actual);
129
         assertFalse(actual);
130
     }
130
     }
131
 
131
 
132
-    @Test
133
     @Ignore("Remove to run test")
132
     @Ignore("Remove to run test")
133
+    @Test
134
     public void theEmptySetIsDisjointWithItself() {
134
     public void theEmptySetIsDisjointWithItself() {
135
         final boolean actual
135
         final boolean actual
136
                 = new CustomSet<>(Collections.EMPTY_LIST)
136
                 = new CustomSet<>(Collections.EMPTY_LIST)
141
         assertTrue(actual);
141
         assertTrue(actual);
142
     }
142
     }
143
 
143
 
144
-    @Test
145
     @Ignore("Remove to run test")
144
     @Ignore("Remove to run test")
145
+    @Test
146
     public void emptySetIsDisjointWithNonEmptySet() {
146
     public void emptySetIsDisjointWithNonEmptySet() {
147
         final boolean actual
147
         final boolean actual
148
                 = new CustomSet<>(Collections.EMPTY_LIST)
148
                 = new CustomSet<>(Collections.EMPTY_LIST)
153
         assertTrue(actual);
153
         assertTrue(actual);
154
     }
154
     }
155
 
155
 
156
-    @Test
157
     @Ignore("Remove to run test")
156
     @Ignore("Remove to run test")
157
+    @Test
158
     public void nonEmptySetIsDisjointWithEmptySet() {
158
     public void nonEmptySetIsDisjointWithEmptySet() {
159
         final boolean actual
159
         final boolean actual
160
                 = new CustomSet<>(Arrays.asList(1))
160
                 = new CustomSet<>(Arrays.asList(1))
165
         assertTrue(actual);
165
         assertTrue(actual);
166
     }
166
     }
167
 
167
 
168
-    @Test
169
     @Ignore("Remove to run test")
168
     @Ignore("Remove to run test")
169
+    @Test
170
     public void setsAreNotDisjointIfTheyShareAnElement() {
170
     public void setsAreNotDisjointIfTheyShareAnElement() {
171
         final boolean actual
171
         final boolean actual
172
                 = new CustomSet<>(Arrays.asList(1, 2))
172
                 = new CustomSet<>(Arrays.asList(1, 2))
177
         assertFalse(actual);
177
         assertFalse(actual);
178
     }
178
     }
179
 
179
 
180
-    @Test
181
     @Ignore("Remove to run test")
180
     @Ignore("Remove to run test")
181
+    @Test
182
     public void setsAreDisjointIfTheyShareNoElements() {
182
     public void setsAreDisjointIfTheyShareNoElements() {
183
         final boolean actual
183
         final boolean actual
184
                 = new CustomSet<>(Arrays.asList(1, 2))
184
                 = new CustomSet<>(Arrays.asList(1, 2))
189
         assertTrue(actual);
189
         assertTrue(actual);
190
     }
190
     }
191
 
191
 
192
-    @Test
193
     @Ignore("Remove to run test")
192
     @Ignore("Remove to run test")
193
+    @Test
194
     public void emptySetsAreEqual() {
194
     public void emptySetsAreEqual() {
195
         final boolean actual
195
         final boolean actual
196
                 = new CustomSet<>(Collections.EMPTY_LIST)
196
                 = new CustomSet<>(Collections.EMPTY_LIST)
201
         assertTrue(actual);
201
         assertTrue(actual);
202
     }
202
     }
203
 
203
 
204
-    @Test
205
     @Ignore("Remove to run test")
204
     @Ignore("Remove to run test")
205
+    @Test
206
     public void emptySetIsNotEqualToNonEmptySet() {
206
     public void emptySetIsNotEqualToNonEmptySet() {
207
         final boolean actual
207
         final boolean actual
208
                 = new CustomSet<>(Collections.EMPTY_LIST)
208
                 = new CustomSet<>(Collections.EMPTY_LIST)
213
         assertFalse(actual);
213
         assertFalse(actual);
214
     }
214
     }
215
 
215
 
216
-    @Test
217
     @Ignore("Remove to run test")
216
     @Ignore("Remove to run test")
217
+    @Test
218
     public void nonEmptySetIsNotEqualToEmptySet() {
218
     public void nonEmptySetIsNotEqualToEmptySet() {
219
         final boolean actual
219
         final boolean actual
220
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
220
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
225
         assertFalse(actual);
225
         assertFalse(actual);
226
     }
226
     }
227
 
227
 
228
-    @Test
229
     @Ignore("Remove to run test")
228
     @Ignore("Remove to run test")
229
+    @Test
230
     public void setsWithTheSameElementsAreEqual() {
230
     public void setsWithTheSameElementsAreEqual() {
231
         final boolean actual
231
         final boolean actual
232
                 = new CustomSet<>(Arrays.asList(1, 2))
232
                 = new CustomSet<>(Arrays.asList(1, 2))
237
         assertTrue(actual);
237
         assertTrue(actual);
238
     }
238
     }
239
 
239
 
240
-    @Test
241
     @Ignore("Remove to run test")
240
     @Ignore("Remove to run test")
241
+    @Test
242
     public void setsWithDifferentElementsAreNotEqual() {
242
     public void setsWithDifferentElementsAreNotEqual() {
243
         final boolean actual
243
         final boolean actual
244
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
244
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
249
         assertFalse(actual);
249
         assertFalse(actual);
250
     }
250
     }
251
 
251
 
252
-    @Test
253
     @Ignore("Remove to run test")
252
     @Ignore("Remove to run test")
253
+    @Test
254
     public void addToEmptySet() {
254
     public void addToEmptySet() {
255
         final int element = 3;
255
         final int element = 3;
256
         final CustomSet<Integer> expected
256
         final CustomSet<Integer> expected
267
         assertTrue(expected.equals(actual));
267
         assertTrue(expected.equals(actual));
268
     }
268
     }
269
 
269
 
270
-    @Test
271
     @Ignore("Remove to run test")
270
     @Ignore("Remove to run test")
271
+    @Test
272
     public void addToNonEmptySet() {
272
     public void addToNonEmptySet() {
273
         final int element = 3;
273
         final int element = 3;
274
         final CustomSet<Integer> expected
274
         final CustomSet<Integer> expected
285
         assertTrue(expected.equals(actual));
285
         assertTrue(expected.equals(actual));
286
     }
286
     }
287
 
287
 
288
-    @Test
289
     @Ignore("Remove to run test")
288
     @Ignore("Remove to run test")
289
+    @Test
290
     public void addingAnExistingElementDoesNotChangeTheSet() {
290
     public void addingAnExistingElementDoesNotChangeTheSet() {
291
         final int element = 3;
291
         final int element = 3;
292
         final CustomSet<Integer> expected
292
         final CustomSet<Integer> expected
302
         assertTrue(expected.equals(actual));
302
         assertTrue(expected.equals(actual));
303
     }
303
     }
304
 
304
 
305
-    @Test
306
     @Ignore("Remove to run test")
305
     @Ignore("Remove to run test")
306
+    @Test
307
     public void intersectionOfTwoEmptySetsIsAnEmptySet() {
307
     public void intersectionOfTwoEmptySetsIsAnEmptySet() {
308
         final CustomSet<Integer> actual
308
         final CustomSet<Integer> actual
309
                 = new CustomSet<>(Collections.EMPTY_LIST)
309
                 = new CustomSet<>(Collections.EMPTY_LIST)
315
         assertTrue(actual.isEmpty());
315
         assertTrue(actual.isEmpty());
316
     }
316
     }
317
 
317
 
318
-    @Test
319
     @Ignore("Remove to run test")
318
     @Ignore("Remove to run test")
319
+    @Test
320
     public void intersectionOfAnEmptySetAndNonEmptySetIsAnEmptySet() {
320
     public void intersectionOfAnEmptySetAndNonEmptySetIsAnEmptySet() {
321
         final CustomSet<Integer> actual
321
         final CustomSet<Integer> actual
322
                 = new CustomSet<>(Collections.EMPTY_LIST)
322
                 = new CustomSet<>(Collections.EMPTY_LIST)
328
         assertTrue(actual.isEmpty());
328
         assertTrue(actual.isEmpty());
329
     }
329
     }
330
 
330
 
331
-    @Test
332
     @Ignore("Remove to run test")
331
     @Ignore("Remove to run test")
332
+    @Test
333
     public void intersectionOfANonEmptySetAndAnEmptySetIsAnEmptySet() {
333
     public void intersectionOfANonEmptySetAndAnEmptySetIsAnEmptySet() {
334
         final CustomSet<Integer> actual
334
         final CustomSet<Integer> actual
335
                 = new CustomSet<>(Arrays.asList(1, 2, 3, 4))
335
                 = new CustomSet<>(Arrays.asList(1, 2, 3, 4))
342
 
342
 
343
     }
343
     }
344
 
344
 
345
-    @Test
346
     @Ignore("Remove to run test")
345
     @Ignore("Remove to run test")
346
+    @Test
347
     public void intersectionOfTwoSetsWithNoSharedElementsIsAnEmptySet() {
347
     public void intersectionOfTwoSetsWithNoSharedElementsIsAnEmptySet() {
348
         final CustomSet<Integer> actual
348
         final CustomSet<Integer> actual
349
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
349
                 = new CustomSet<>(Arrays.asList(1, 2, 3))
355
         assertTrue(actual.isEmpty());
355
         assertTrue(actual.isEmpty());
356
     }
356
     }
357
 
357
 
358
-    @Test
359
     @Ignore("Remove to run test")
358
     @Ignore("Remove to run test")
359
+    @Test
360
     public void intersectionOfTwoSetsWithSharedElementsIsASetOfTheSharedElements() {
360
     public void intersectionOfTwoSetsWithSharedElementsIsASetOfTheSharedElements() {
361
         final CustomSet<Integer> expected
361
         final CustomSet<Integer> expected
362
                 = new CustomSet<>(
362
                 = new CustomSet<>(
373
         assertTrue(expected.equals(actual));
373
         assertTrue(expected.equals(actual));
374
     }
374
     }
375
 
375
 
376
-    @Test
377
     @Ignore("Remove to run test")
376
     @Ignore("Remove to run test")
377
+    @Test
378
     public void differenceOfTwoEmptySetsIsAnEmptySet() {
378
     public void differenceOfTwoEmptySetsIsAnEmptySet() {
379
         final CustomSet<Integer> actual
379
         final CustomSet<Integer> actual
380
                 = new CustomSet<>(Collections.EMPTY_LIST)
380
                 = new CustomSet<>(Collections.EMPTY_LIST)
386
         assertTrue(actual.isEmpty());
386
         assertTrue(actual.isEmpty());
387
     }
387
     }
388
 
388
 
389
-    @Test
390
     @Ignore("Remove to run test")
389
     @Ignore("Remove to run test")
390
+    @Test
391
     public void differenceOfAnEmptySetAndNonEmptySetIsAnEmptySet() {
391
     public void differenceOfAnEmptySetAndNonEmptySetIsAnEmptySet() {
392
         final CustomSet<Integer> actual
392
         final CustomSet<Integer> actual
393
                 = new CustomSet<>(Collections.EMPTY_LIST)
393
                 = new CustomSet<>(Collections.EMPTY_LIST)
399
         assertTrue(actual.isEmpty());
399
         assertTrue(actual.isEmpty());
400
     }
400
     }
401
 
401
 
402
-    @Test
403
     @Ignore("Remove to run test")
402
     @Ignore("Remove to run test")
403
+    @Test
404
     public void differenceOfANonEmptySetAndAnEmptySetIsTheNonEmptySet() {
404
     public void differenceOfANonEmptySetAndAnEmptySetIsTheNonEmptySet() {
405
         final CustomSet<Integer> expected
405
         final CustomSet<Integer> expected
406
                 = new CustomSet<>(
406
                 = new CustomSet<>(
417
         assertTrue(expected.equals(actual));
417
         assertTrue(expected.equals(actual));
418
     }
418
     }
419
 
419
 
420
-    @Test
421
     @Ignore("Remove to run test")
420
     @Ignore("Remove to run test")
421
+    @Test
422
     public void differenceOfTwoNonEmptySetsIsASetOfElementsThatAreOnlyInTheFirstSet() {
422
     public void differenceOfTwoNonEmptySetsIsASetOfElementsThatAreOnlyInTheFirstSet() {
423
         final CustomSet<Integer> expected
423
         final CustomSet<Integer> expected
424
                 = new CustomSet<>(
424
                 = new CustomSet<>(
435
         assertTrue(expected.equals(actual));
435
         assertTrue(expected.equals(actual));
436
     }
436
     }
437
 
437
 
438
-    @Test
439
     @Ignore("Remove to run test")
438
     @Ignore("Remove to run test")
439
+    @Test
440
     public void unionOfTwoEmptySetsIsAnEmptySet() {
440
     public void unionOfTwoEmptySetsIsAnEmptySet() {
441
         final CustomSet<Integer> actual
441
         final CustomSet<Integer> actual
442
                 = new CustomSet<>(Collections.EMPTY_LIST)
442
                 = new CustomSet<>(Collections.EMPTY_LIST)
448
         assertTrue(actual.isEmpty());
448
         assertTrue(actual.isEmpty());
449
     }
449
     }
450
 
450
 
451
-    @Test
452
     @Ignore("Remove to run test")
451
     @Ignore("Remove to run test")
452
+    @Test
453
     public void unionOfAnEmptySetAndNonEmptySetIsTheNonEmptySet() {
453
     public void unionOfAnEmptySetAndNonEmptySetIsTheNonEmptySet() {
454
         final CustomSet<Integer> expected
454
         final CustomSet<Integer> expected
455
                 = new CustomSet<>(
455
                 = new CustomSet<>(
466
         assertTrue(expected.equals(actual));
466
         assertTrue(expected.equals(actual));
467
     }
467
     }
468
 
468
 
469
-    @Test
470
     @Ignore("Remove to run test")
469
     @Ignore("Remove to run test")
470
+    @Test
471
     public void unionOfANonEmptySetAndAnEmptySetIsTheNonEmptySet() {
471
     public void unionOfANonEmptySetAndAnEmptySetIsTheNonEmptySet() {
472
         final CustomSet<Integer> expected
472
         final CustomSet<Integer> expected
473
                 = new CustomSet<>(
473
                 = new CustomSet<>(
484
         assertTrue(expected.equals(actual));
484
         assertTrue(expected.equals(actual));
485
     }
485
     }
486
 
486
 
487
-    @Test
488
     @Ignore("Remove to run test")
487
     @Ignore("Remove to run test")
488
+    @Test
489
     public void unionOfTwoNonEmptySetsContainsAllUniqueElements() {
489
     public void unionOfTwoNonEmptySetsContainsAllUniqueElements() {
490
         final CustomSet<Integer> expected
490
         final CustomSet<Integer> expected
491
                 = new CustomSet<>(
491
                 = new CustomSet<>(

+ 4
- 4
exercises/palindrome-products/src/test/java/PalindromeCalculatorTest.java Просмотреть файл

35
         checkPalindromeWithFactorsMatchesExpected(expected, expectedValue, palindromes, palindromes.lastKey());
35
         checkPalindromeWithFactorsMatchesExpected(expected, expectedValue, palindromes, palindromes.lastKey());
36
     }
36
     }
37
 
37
 
38
-    @Test
39
     @Ignore("Remove to run test")
38
     @Ignore("Remove to run test")
39
+    @Test
40
     public void largestPalindromeFromDoubleDigitFactors() {
40
     public void largestPalindromeFromDoubleDigitFactors() {
41
         final List<List<Integer>> expected = Collections.unmodifiableList(
41
         final List<List<Integer>> expected = Collections.unmodifiableList(
42
                 Arrays.asList(
42
                 Arrays.asList(
50
         checkPalindromeWithFactorsMatchesExpected(expected, expectedValue, palindromes, palindromes.lastKey());
50
         checkPalindromeWithFactorsMatchesExpected(expected, expectedValue, palindromes, palindromes.lastKey());
51
     }
51
     }
52
 
52
 
53
-    @Test
54
     @Ignore("Remove to run test")
53
     @Ignore("Remove to run test")
54
+    @Test
55
     public void smallestPalindromeFromDoubleDigitFactors() {
55
     public void smallestPalindromeFromDoubleDigitFactors() {
56
         final List<List<Integer>> expected = Collections.unmodifiableList(
56
         final List<List<Integer>> expected = Collections.unmodifiableList(
57
                 Arrays.asList(
57
                 Arrays.asList(
65
         checkPalindromeWithFactorsMatchesExpected(expected, expectedValue, palindromes, palindromes.firstKey());
65
         checkPalindromeWithFactorsMatchesExpected(expected, expectedValue, palindromes, palindromes.firstKey());
66
     }
66
     }
67
 
67
 
68
-    @Test
69
     @Ignore("Remove to run test")
68
     @Ignore("Remove to run test")
69
+    @Test
70
     public void largestPalindromeFromTripleDigitFactors() {
70
     public void largestPalindromeFromTripleDigitFactors() {
71
         final List<List<Integer>> expected = Collections.unmodifiableList(
71
         final List<List<Integer>> expected = Collections.unmodifiableList(
72
                 Arrays.asList(
72
                 Arrays.asList(
80
         checkPalindromeWithFactorsMatchesExpected(expected, expectedValue, palindromes, palindromes.lastKey());
80
         checkPalindromeWithFactorsMatchesExpected(expected, expectedValue, palindromes, palindromes.lastKey());
81
     }
81
     }
82
 
82
 
83
-    @Test
84
     @Ignore("Remove to run test")
83
     @Ignore("Remove to run test")
84
+    @Test
85
     public void smallestPalindromeFromTripleDigitFactors() {
85
     public void smallestPalindromeFromTripleDigitFactors() {
86
         final List<List<Integer>> expected = Collections.unmodifiableList(
86
         final List<List<Integer>> expected = Collections.unmodifiableList(
87
                 Arrays.asList(
87
                 Arrays.asList(

+ 18
- 18
exercises/poker/src/test/java/PokerTest.java Просмотреть файл

13
         assertEquals(Arrays.asList(hand),new Poker(Arrays.asList(hand)).getBestHands());
13
         assertEquals(Arrays.asList(hand),new Poker(Arrays.asList(hand)).getBestHands());
14
     }
14
     }
15
 
15
 
16
-    @Test
17
     @Ignore("Remove to run test")
16
     @Ignore("Remove to run test")
17
+    @Test
18
     public void nothingVsOnePair() {
18
     public void nothingVsOnePair() {
19
         final String nothing = "4S 5H 6S 8D JH";
19
         final String nothing = "4S 5H 6S 8D JH";
20
         final String pairOf4 = "2S 4H 6S 4D JH";
20
         final String pairOf4 = "2S 4H 6S 4D JH";
21
         assertEquals(Arrays.asList(pairOf4),new Poker(Arrays.asList(nothing, pairOf4)).getBestHands());
21
         assertEquals(Arrays.asList(pairOf4),new Poker(Arrays.asList(nothing, pairOf4)).getBestHands());
22
     }
22
     }
23
 
23
 
24
-    @Test
25
     @Ignore("Remove to run test")
24
     @Ignore("Remove to run test")
25
+    @Test
26
     public void twoPairs() {
26
     public void twoPairs() {
27
         final String pairOf2 = "4S 2H 6S 2D JH";
27
         final String pairOf2 = "4S 2H 6S 2D JH";
28
         final String pairOf4 = "2S 4H 6S 4D JH";
28
         final String pairOf4 = "2S 4H 6S 4D JH";
29
         assertEquals(Arrays.asList(pairOf4), new Poker(Arrays.asList(pairOf2,pairOf4)).getBestHands());
29
         assertEquals(Arrays.asList(pairOf4), new Poker(Arrays.asList(pairOf2,pairOf4)).getBestHands());
30
     }
30
     }
31
 
31
 
32
-    @Test
33
     @Ignore("Remove to run test")
32
     @Ignore("Remove to run test")
33
+    @Test
34
     public void onePairVsDoublePair() {
34
     public void onePairVsDoublePair() {
35
         final String pairOf8 = "2S 8H 6S 8D JH";
35
         final String pairOf8 = "2S 8H 6S 8D JH";
36
         final String doublePair = "4S 5H 4S 8D 5H";
36
         final String doublePair = "4S 5H 4S 8D 5H";
37
         assertEquals(Arrays.asList(doublePair),  new Poker(Arrays.asList(pairOf8, doublePair)).getBestHands());
37
         assertEquals(Arrays.asList(doublePair),  new Poker(Arrays.asList(pairOf8, doublePair)).getBestHands());
38
     }
38
     }
39
 
39
 
40
-    @Test
41
     @Ignore("Remove to run test")
40
     @Ignore("Remove to run test")
41
+    @Test
42
     public void twoDoublePairs() {
42
     public void twoDoublePairs() {
43
         final String doublePair2And8 = "2S 8H 2S 8D JH";
43
         final String doublePair2And8 = "2S 8H 2S 8D JH";
44
         final String doublePair4And5 = "4S 5H 4S 8D 5H";
44
         final String doublePair4And5 = "4S 5H 4S 8D 5H";
45
         assertEquals(Arrays.asList(doublePair2And8), new Poker(Arrays.asList(doublePair2And8, doublePair4And5)).getBestHands());
45
         assertEquals(Arrays.asList(doublePair2And8), new Poker(Arrays.asList(doublePair2And8, doublePair4And5)).getBestHands());
46
     }
46
     }
47
 
47
 
48
-    @Test
49
     @Ignore("Remove to run test")
48
     @Ignore("Remove to run test")
49
+    @Test
50
     public void doublePairVsThree() {
50
     public void doublePairVsThree() {
51
         final String doublePair2And8 = "2S 8H 2S 8D JH";
51
         final String doublePair2And8 = "2S 8H 2S 8D JH";
52
         final String threeOf4 = "4S 5H 4S 8D 4H";
52
         final String threeOf4 = "4S 5H 4S 8D 4H";
53
         assertEquals(Arrays.asList(threeOf4 ), new Poker(Arrays.asList(doublePair2And8, threeOf4)).getBestHands());
53
         assertEquals(Arrays.asList(threeOf4 ), new Poker(Arrays.asList(doublePair2And8, threeOf4)).getBestHands());
54
     }
54
     }
55
 
55
 
56
-    @Test
57
     @Ignore("Remove to run test")
56
     @Ignore("Remove to run test")
57
+    @Test
58
     public void twoThrees() {
58
     public void twoThrees() {
59
         final String threeOf2 = "2S 2H 2S 8D JH";
59
         final String threeOf2 = "2S 2H 2S 8D JH";
60
         final String threeOf1 = "4S AH AS 8D AH";
60
         final String threeOf1 = "4S AH AS 8D AH";
61
         assertEquals(Arrays.asList(threeOf1), new Poker(Arrays.asList(threeOf2, threeOf1)).getBestHands());
61
         assertEquals(Arrays.asList(threeOf1), new Poker(Arrays.asList(threeOf2, threeOf1)).getBestHands());
62
     }
62
     }
63
 
63
 
64
-    @Test
65
     @Ignore("Remove to run test")
64
     @Ignore("Remove to run test")
65
+    @Test
66
     public void threeVsStraight() {
66
     public void threeVsStraight() {
67
         final String threeOf4 = "4S 5H 4S 8D 4H";
67
         final String threeOf4 = "4S 5H 4S 8D 4H";
68
         final String straight = "3S 4H 2S 6D 5H";
68
         final String straight = "3S 4H 2S 6D 5H";
69
         assertEquals(Arrays.asList(straight), new Poker(Arrays.asList(threeOf4, straight)).getBestHands());
69
         assertEquals(Arrays.asList(straight), new Poker(Arrays.asList(threeOf4, straight)).getBestHands());
70
     }
70
     }
71
 
71
 
72
-    @Test
73
     @Ignore("Remove to run test")
72
     @Ignore("Remove to run test")
73
+    @Test
74
     public void twoStraights() {
74
     public void twoStraights() {
75
         final String straightTo8 = "4S 6H 7S 8D 5H";
75
         final String straightTo8 = "4S 6H 7S 8D 5H";
76
         final String straightTo9 = "5S 7H 8S 9D 6H";
76
         final String straightTo9 = "5S 7H 8S 9D 6H";
81
         assertEquals(Arrays.asList(straightTo1), new Poker(Arrays.asList(straightTo1, straightTo5)).getBestHands());
81
         assertEquals(Arrays.asList(straightTo1), new Poker(Arrays.asList(straightTo1, straightTo5)).getBestHands());
82
     }
82
     }
83
 
83
 
84
-    @Test
85
     @Ignore("Remove to run test")
84
     @Ignore("Remove to run test")
85
+    @Test
86
     public void straightVsFlush() {
86
     public void straightVsFlush() {
87
         final String straightTo8 = "4S 6H 7S 8D 5H";
87
         final String straightTo8 = "4S 6H 7S 8D 5H";
88
         final String flushTo7 = "2S 4S 5S 6S 7S";
88
         final String flushTo7 = "2S 4S 5S 6S 7S";
89
         assertEquals(Arrays.asList(flushTo7 ), new Poker(Arrays.asList(straightTo8, flushTo7)).getBestHands());
89
         assertEquals(Arrays.asList(flushTo7 ), new Poker(Arrays.asList(straightTo8, flushTo7)).getBestHands());
90
     }
90
     }
91
 
91
 
92
-    @Test
93
     @Ignore("Remove to run test")
92
     @Ignore("Remove to run test")
93
+    @Test
94
     public void twoFlushes() {
94
     public void twoFlushes() {
95
         final String flushTo8 = "3H 6H 7H 8H 5H";
95
         final String flushTo8 = "3H 6H 7H 8H 5H";
96
         final String flushTo7 = "2S 4S 5S 6S 7S";
96
         final String flushTo7 = "2S 4S 5S 6S 7S";
97
         assertEquals(Arrays.asList(flushTo8), new Poker(Arrays.asList(flushTo8, flushTo7)).getBestHands());
97
         assertEquals(Arrays.asList(flushTo8), new Poker(Arrays.asList(flushTo8, flushTo7)).getBestHands());
98
     }
98
     }
99
 
99
 
100
-    @Test
101
     @Ignore("Remove to run test")
100
     @Ignore("Remove to run test")
101
+    @Test
102
     public void flushVsFull() {
102
     public void flushVsFull() {
103
         final String flushTo8 = "3H 6H 7H 8H 5H";
103
         final String flushTo8 = "3H 6H 7H 8H 5H";
104
         final String full = "4S 5H 4S 5D 4H";
104
         final String full = "4S 5H 4S 5D 4H";
105
         assertEquals(Arrays.asList(full ), new Poker(Arrays.asList(full, flushTo8)).getBestHands());
105
         assertEquals(Arrays.asList(full ), new Poker(Arrays.asList(full, flushTo8)).getBestHands());
106
     }
106
     }
107
 
107
 
108
-    @Test
109
     @Ignore("Remove to run test")
108
     @Ignore("Remove to run test")
109
+    @Test
110
     public void twoFulls() {
110
     public void twoFulls() {
111
         final String fullOf4By9 = "4H 4S 4D 9S 9D";
111
         final String fullOf4By9 = "4H 4S 4D 9S 9D";
112
         final String fullOf5By8 = "5H 5S 5D 8S 8D";
112
         final String fullOf5By8 = "5H 5S 5D 8S 8D";
113
         assertEquals(Arrays.asList(fullOf5By8 ), new Poker(Arrays.asList(fullOf4By9, fullOf5By8)).getBestHands());
113
         assertEquals(Arrays.asList(fullOf5By8 ), new Poker(Arrays.asList(fullOf4By9, fullOf5By8)).getBestHands());
114
     }
114
     }
115
 
115
 
116
-    @Test
117
     @Ignore("Remove to run test")
116
     @Ignore("Remove to run test")
117
+    @Test
118
     public void fullVsSquare() {
118
     public void fullVsSquare() {
119
         final String full = "4S 5H 4S 5D 4H";
119
         final String full = "4S 5H 4S 5D 4H";
120
         final String squareOf3 = "3S 3H 2S 3D 3H";
120
         final String squareOf3 = "3S 3H 2S 3D 3H";
121
         assertEquals(Arrays.asList(squareOf3 ), new Poker(Arrays.asList(full, squareOf3)).getBestHands());
121
         assertEquals(Arrays.asList(squareOf3 ), new Poker(Arrays.asList(full, squareOf3)).getBestHands());
122
     }
122
     }
123
 
123
 
124
-    @Test
125
     @Ignore("Remove to run test")
124
     @Ignore("Remove to run test")
125
+    @Test
126
     public void twoSquares() {
126
     public void twoSquares() {
127
         final String squareOf2 = "2S 2H 2S 8D 2H";
127
         final String squareOf2 = "2S 2H 2S 8D 2H";
128
         final String squareOf5 = "4S 5H 5S 5D 5H";
128
         final String squareOf5 = "4S 5H 5S 5D 5H";
129
         assertEquals(Arrays.asList(squareOf5), new Poker(Arrays.asList(squareOf2, squareOf5)).getBestHands());
129
         assertEquals(Arrays.asList(squareOf5), new Poker(Arrays.asList(squareOf2, squareOf5)).getBestHands());
130
     }
130
     }
131
 
131
 
132
-    @Test
133
     @Ignore("Remove to run test")
132
     @Ignore("Remove to run test")
133
+    @Test
134
     public void squareVsStraightFlush() {
134
     public void squareVsStraightFlush() {
135
         final String squareOf5 = "4S 5H 5S 5D 5H";
135
         final String squareOf5 = "4S 5H 5S 5D 5H";
136
         final String straightFlushTo9 = "5S 7S 8S 9S 6S";
136
         final String straightFlushTo9 = "5S 7S 8S 9S 6S";
137
         assertEquals(Arrays.asList(straightFlushTo9 ), new Poker(Arrays.asList(squareOf5, straightFlushTo9)).getBestHands());
137
         assertEquals(Arrays.asList(straightFlushTo9 ), new Poker(Arrays.asList(squareOf5, straightFlushTo9)).getBestHands());
138
     }
138
     }
139
 
139
 
140
-    @Test
141
     @Ignore("Remove to run test")
140
     @Ignore("Remove to run test")
141
+    @Test
142
     public void twoStraightFlushes() {
142
     public void twoStraightFlushes() {
143
         final String straightFlushTo8 = "4H 6H 7H 8H 5H";
143
         final String straightFlushTo8 = "4H 6H 7H 8H 5H";
144
         final String straightFlushTo9 = "5S 7S 8S 9S 6S";
144
         final String straightFlushTo9 = "5S 7S 8S 9S 6S";
145
         assertEquals(Arrays.asList(straightFlushTo9 ), new Poker(Arrays.asList(straightFlushTo8, straightFlushTo9)).getBestHands());
145
         assertEquals(Arrays.asList(straightFlushTo9 ), new Poker(Arrays.asList(straightFlushTo8, straightFlushTo9)).getBestHands());
146
     }
146
     }
147
 
147
 
148
-    @Test
149
     @Ignore("Remove to run test")
148
     @Ignore("Remove to run test")
149
+    @Test
150
     public void threeHandWithTie() {
150
     public void threeHandWithTie() {
151
         final String spadeStraightTo9 = "9S 8S 7S 6S 5S";
151
         final String spadeStraightTo9 = "9S 8S 7S 6S 5S";
152
         final String diamondStraightTo9 = "9D 8D 7D 6D 5D";
152
         final String diamondStraightTo9 = "9D 8D 7D 6D 5D";
154
         assertEquals(Arrays.asList(spadeStraightTo9, diamondStraightTo9), new Poker(Arrays.asList(spadeStraightTo9, diamondStraightTo9, threeOf4)).getBestHands());
154
         assertEquals(Arrays.asList(spadeStraightTo9, diamondStraightTo9), new Poker(Arrays.asList(spadeStraightTo9, diamondStraightTo9, threeOf4)).getBestHands());
155
     }
155
     }
156
 
156
 
157
-    @Test
158
     @Ignore("Remove to run test")
157
     @Ignore("Remove to run test")
158
+    @Test
159
     public void straightTo5AgainstAPairOfJacks() {
159
     public void straightTo5AgainstAPairOfJacks() {
160
         final String straightTo5 = "2S 4D 5C 3S AS";
160
         final String straightTo5 = "2S 4D 5C 3S AS";
161
         final String twoJacks = "JD 8D 7D JC 5D";
161
         final String twoJacks = "JD 8D 7D JC 5D";

+ 6
- 6
exercises/pythagorean-triplet/src/test/java/PythagoreanTripletTest.java Просмотреть файл

20
         assertEquals(expected, actual);
20
         assertEquals(expected, actual);
21
     }
21
     }
22
 
22
 
23
-    @Test
24
     @Ignore("Remove to run test")
23
     @Ignore("Remove to run test")
24
+    @Test
25
     public void shouldCalculateProduct() {
25
     public void shouldCalculateProduct() {
26
         PythagoreanTriplet triplet = new PythagoreanTriplet(3, 4, 5);
26
         PythagoreanTriplet triplet = new PythagoreanTriplet(3, 4, 5);
27
         final long expected = 60l;
27
         final long expected = 60l;
29
         assertEquals(expected, actual);
29
         assertEquals(expected, actual);
30
     }
30
     }
31
 
31
 
32
-    @Test
33
     @Ignore("Remove to run test")
32
     @Ignore("Remove to run test")
33
+    @Test
34
     public void testIsPythagoreanOK() {
34
     public void testIsPythagoreanOK() {
35
         PythagoreanTriplet triplet = new PythagoreanTriplet(3, 4, 5);
35
         PythagoreanTriplet triplet = new PythagoreanTriplet(3, 4, 5);
36
         assertTrue(triplet.isPythagorean());
36
         assertTrue(triplet.isPythagorean());
37
     }
37
     }
38
 
38
 
39
-    @Test
40
     @Ignore("Remove to run test")
39
     @Ignore("Remove to run test")
40
+    @Test
41
     public void testIsPythagoreanFail() {
41
     public void testIsPythagoreanFail() {
42
         PythagoreanTriplet triplet = new PythagoreanTriplet(5, 6, 7);
42
         PythagoreanTriplet triplet = new PythagoreanTriplet(5, 6, 7);
43
         assertFalse(triplet.isPythagorean());
43
         assertFalse(triplet.isPythagorean());
44
     }
44
     }
45
 
45
 
46
-    @Test
47
     @Ignore("Remove to run test")
46
     @Ignore("Remove to run test")
47
+    @Test
48
     public void shouldMakeTripletsUpToTen() {
48
     public void shouldMakeTripletsUpToTen() {
49
         final List<Long> actual
49
         final List<Long> actual
50
                 = PythagoreanTriplet
50
                 = PythagoreanTriplet
59
         assertEquals(expected, actual);
59
         assertEquals(expected, actual);
60
     }
60
     }
61
 
61
 
62
-    @Test
63
     @Ignore("Remove to run test")
62
     @Ignore("Remove to run test")
63
+    @Test
64
     public void shouldMakeTripletsElevenToTwenty() {
64
     public void shouldMakeTripletsElevenToTwenty() {
65
         final List<Long> actual
65
         final List<Long> actual
66
                 = PythagoreanTriplet
66
                 = PythagoreanTriplet
76
         assertEquals(expected, actual);
76
         assertEquals(expected, actual);
77
     }
77
     }
78
 
78
 
79
-    @Test
80
     @Ignore("Remove to run test")
79
     @Ignore("Remove to run test")
80
+    @Test
81
     public void shouldMakeTripletsAndFilterOnSum() {
81
     public void shouldMakeTripletsAndFilterOnSum() {
82
         final List<Long> actual
82
         final List<Long> actual
83
                 = PythagoreanTriplet
83
                 = PythagoreanTriplet

+ 10
- 10
exercises/series/src/test/java/SeriesTest.java Просмотреть файл

25
         assertEquals(expected, actual);
25
         assertEquals(expected, actual);
26
     }
26
     }
27
 
27
 
28
-    @Test
29
     @Ignore("Remove to run test")
28
     @Ignore("Remove to run test")
29
+    @Test
30
     public void hasDigitsLong() {
30
     public void hasDigitsLong() {
31
         Series series = new Series("0123456789");
31
         Series series = new Series("0123456789");
32
         List<Integer> expected = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
32
         List<Integer> expected = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
36
         assertEquals(expected, actual);
36
         assertEquals(expected, actual);
37
     }
37
     }
38
 
38
 
39
-    @Test
40
     @Ignore("Remove to run test")
39
     @Ignore("Remove to run test")
40
+    @Test
41
     public void keepsTheDigitOrderIfReversed() {
41
     public void keepsTheDigitOrderIfReversed() {
42
         Series series = new Series("9876543210");
42
         Series series = new Series("9876543210");
43
         List<Integer> expected = Arrays.asList(9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
43
         List<Integer> expected = Arrays.asList(9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
47
         assertEquals(expected, actual);
47
         assertEquals(expected, actual);
48
     }
48
     }
49
 
49
 
50
-    @Test
51
     @Ignore("Remove to run test")
50
     @Ignore("Remove to run test")
51
+    @Test
52
     public void keepsArbitraryDigitOrder() {
52
     public void keepsArbitraryDigitOrder() {
53
         Series series = new Series("936923468");
53
         Series series = new Series("936923468");
54
         List<Integer> expected = Arrays.asList(9, 3, 6, 9, 2, 3, 4, 6, 8);
54
         List<Integer> expected = Arrays.asList(9, 3, 6, 9, 2, 3, 4, 6, 8);
58
         assertEquals(expected, actual);
58
         assertEquals(expected, actual);
59
     }
59
     }
60
 
60
 
61
-    @Test
62
     @Ignore("Remove to run test")
61
     @Ignore("Remove to run test")
62
+    @Test
63
     public void canSliceByOne() {
63
     public void canSliceByOne() {
64
         Series series = new Series("01234");
64
         Series series = new Series("01234");
65
         List<List<Integer>> expected = Arrays.asList(
65
         List<List<Integer>> expected = Arrays.asList(
75
         assertEquals(expected, actual);
75
         assertEquals(expected, actual);
76
     }
76
     }
77
 
77
 
78
-    @Test
79
     @Ignore("Remove to run test")
78
     @Ignore("Remove to run test")
79
+    @Test
80
     public void canSliceByTwo() {
80
     public void canSliceByTwo() {
81
         Series series = new Series("98273463");
81
         Series series = new Series("98273463");
82
         List<List<Integer>> expected = Arrays.asList(
82
         List<List<Integer>> expected = Arrays.asList(
94
         assertEquals(expected, actual);
94
         assertEquals(expected, actual);
95
     }
95
     }
96
 
96
 
97
-    @Test
98
     @Ignore("Remove to run test")
97
     @Ignore("Remove to run test")
98
+    @Test
99
     public void canSliceByThree() {
99
     public void canSliceByThree() {
100
         Series series = new Series("01234");
100
         Series series = new Series("01234");
101
         List<List<Integer>> expected = Arrays.asList(
101
         List<List<Integer>> expected = Arrays.asList(
109
         assertEquals(expected, actual);
109
         assertEquals(expected, actual);
110
     }
110
     }
111
 
111
 
112
-    @Test
113
     @Ignore("Remove to run test")
112
     @Ignore("Remove to run test")
113
+    @Test
114
     public void canSliceByThreeWithDuplicateDigits() {
114
     public void canSliceByThreeWithDuplicateDigits() {
115
         Series series = new Series("31001");
115
         Series series = new Series("31001");
116
         List<List<Integer>> expected = Arrays.asList(
116
         List<List<Integer>> expected = Arrays.asList(
124
         assertEquals(expected, actual);
124
         assertEquals(expected, actual);
125
     }
125
     }
126
 
126
 
127
-    @Test
128
     @Ignore("Remove to run test")
127
     @Ignore("Remove to run test")
128
+    @Test
129
     public void canSliceByFour() {
129
     public void canSliceByFour() {
130
         Series series = new Series("91274");
130
         Series series = new Series("91274");
131
         List<List<Integer>> expected = Arrays.asList(
131
         List<List<Integer>> expected = Arrays.asList(
138
         assertEquals(expected, actual);
138
         assertEquals(expected, actual);
139
     }
139
     }
140
 
140
 
141
-    @Test
142
     @Ignore("Remove to run test")
141
     @Ignore("Remove to run test")
142
+    @Test
143
     public void canSliceByFive() {
143
     public void canSliceByFive() {
144
         Series series = new Series("81228");
144
         Series series = new Series("81228");
145
         List<List<Integer>> expected = Arrays.asList(
145
         List<List<Integer>> expected = Arrays.asList(
151
         assertEquals(expected, actual);
151
         assertEquals(expected, actual);
152
     }
152
     }
153
 
153
 
154
-    @Test
155
     @Ignore("Remove to run test")
154
     @Ignore("Remove to run test")
155
+    @Test
156
     public void throwsAnErrorIfNotEnoughDigitsToSlice() {
156
     public void throwsAnErrorIfNotEnoughDigitsToSlice() {
157
         expectedException.expect(IllegalArgumentException.class);
157
         expectedException.expect(IllegalArgumentException.class);
158
         new Series("01032987583").slices(12);
158
         new Series("01032987583").slices(12);

+ 11
- 11
exercises/sum-of-multiples/src/test/java/SumOfMultiplesTest.java Просмотреть файл

17
 
17
 
18
     }
18
     }
19
 
19
 
20
-    @Test
21
     @Ignore("Remove to run test")
20
     @Ignore("Remove to run test")
21
+    @Test
22
     public void testSumOfMultiplesOf3and5UpToFour() {
22
     public void testSumOfMultiplesOf3and5UpToFour() {
23
 
23
 
24
         int[] set = {
24
         int[] set = {
30
 
30
 
31
     }
31
     }
32
 
32
 
33
-    @Test
34
     @Ignore("Remove to run test")
33
     @Ignore("Remove to run test")
34
+    @Test
35
     public void testSumOfMultiplesOf3and5UpToTen() {
35
     public void testSumOfMultiplesOf3and5UpToTen() {
36
 
36
 
37
         int[] set = {
37
         int[] set = {
43
 
43
 
44
     }
44
     }
45
 
45
 
46
-    @Test
47
     @Ignore("Remove to run test")
46
     @Ignore("Remove to run test")
47
+    @Test
48
     public void testSumOfMultiplesOf3and5UpToOneHundred() {
48
     public void testSumOfMultiplesOf3and5UpToOneHundred() {
49
 
49
 
50
         int[] set = {
50
         int[] set = {
56
 
56
 
57
     }
57
     }
58
 
58
 
59
-    @Test
60
     @Ignore("Remove to run test")
59
     @Ignore("Remove to run test")
60
+    @Test
61
     public void testSumOfMultiplesOf3and5UpToOneThousand() {
61
     public void testSumOfMultiplesOf3and5UpToOneThousand() {
62
 
62
 
63
         int[] set = {
63
         int[] set = {
69
 
69
 
70
     }
70
     }
71
 
71
 
72
-    @Test
73
     @Ignore("Remove to run test")
72
     @Ignore("Remove to run test")
73
+    @Test
74
     public void testSumOfMultiplesOf7and13and17UpToTwenty() {
74
     public void testSumOfMultiplesOf7and13and17UpToTwenty() {
75
 
75
 
76
         int[] set = {
76
         int[] set = {
83
 
83
 
84
     }
84
     }
85
 
85
 
86
-    @Test
87
     @Ignore("Remove to run test")
86
     @Ignore("Remove to run test")
87
+    @Test
88
     public void testSumOfMultiplesOf4and6UpToFifteen() {
88
     public void testSumOfMultiplesOf4and6UpToFifteen() {
89
 
89
 
90
         int[] set = {
90
         int[] set = {
96
 
96
 
97
     }
97
     }
98
 
98
 
99
-    @Test
100
     @Ignore("Remove to run test")
99
     @Ignore("Remove to run test")
100
+    @Test
101
     public void testSumOfMultiplesOf5and6and8UpToOneHundredFifty() {
101
     public void testSumOfMultiplesOf5and6and8UpToOneHundredFifty() {
102
 
102
 
103
         int[] set = {
103
         int[] set = {
110
 
110
 
111
     }
111
     }
112
 
112
 
113
-    @Test
114
     @Ignore("Remove to run test")
113
     @Ignore("Remove to run test")
114
+    @Test
115
     public void testSumOfMultiplesOf5and25UpToTwoHundredSeventyFive() {
115
     public void testSumOfMultiplesOf5and25UpToTwoHundredSeventyFive() {
116
 
116
 
117
         int[] set = {
117
         int[] set = {
123
 
123
 
124
     }
124
     }
125
 
125
 
126
-    @Test
127
     @Ignore("Remove to run test")
126
     @Ignore("Remove to run test")
127
+    @Test
128
     public void testSumOfMultiplesOf43and47UpToTenThousand() {
128
     public void testSumOfMultiplesOf43and47UpToTenThousand() {
129
 
129
 
130
         int[] set = {
130
         int[] set = {
136
 
136
 
137
     }
137
     }
138
 
138
 
139
-    @Test
140
     @Ignore("Remove to run test")
139
     @Ignore("Remove to run test")
140
+    @Test
141
     public void testSumOfMultiplesOfOneUpToOneHundred() {
141
     public void testSumOfMultiplesOfOneUpToOneHundred() {
142
 
142
 
143
         int[] set = {
143
         int[] set = {
148
 
148
 
149
     }
149
     }
150
 
150
 
151
-    @Test
152
     @Ignore("Remove to run test")
151
     @Ignore("Remove to run test")
152
+    @Test
153
     public void testSumOfMultiplesOfNoneUpToTenThousand() {
153
     public void testSumOfMultiplesOfNoneUpToTenThousand() {
154
 
154
 
155
         int[] set = {};
155
         int[] set = {};

+ 11
- 11
exercises/transpose/src/test/java/TransposeTest.java Просмотреть файл

21
         assertEquals(expected, transpose.transpose(input));
21
         assertEquals(expected, transpose.transpose(input));
22
     }
22
     }
23
 
23
 
24
-    @Test
25
     @Ignore("Remove to run test")
24
     @Ignore("Remove to run test")
25
+    @Test
26
     public void twoCharsInARow() {
26
     public void twoCharsInARow() {
27
         String input = "A1";
27
         String input = "A1";
28
 
28
 
32
         assertEquals(expected, transpose.transpose(input));
32
         assertEquals(expected, transpose.transpose(input));
33
     }
33
     }
34
 
34
 
35
-    @Test
36
     @Ignore("Remove to run test")
35
     @Ignore("Remove to run test")
36
+    @Test
37
     public void twoCharsInAColumn() {
37
     public void twoCharsInAColumn() {
38
         String input = "A\n" +
38
         String input = "A\n" +
39
                        "1";
39
                        "1";
43
         assertEquals(expected, transpose.transpose(input));
43
         assertEquals(expected, transpose.transpose(input));
44
     }
44
     }
45
 
45
 
46
-    @Test
47
     @Ignore("Remove to run test")
46
     @Ignore("Remove to run test")
47
+    @Test
48
     public void simpleMatrix() {
48
     public void simpleMatrix() {
49
         String input = "ABC\n" +
49
         String input = "ABC\n" +
50
                        "123";
50
                        "123";
56
         assertEquals(expected, transpose.transpose(input));
56
         assertEquals(expected, transpose.transpose(input));
57
     }
57
     }
58
 
58
 
59
-    @Test
60
     @Ignore("Remove to run test")
59
     @Ignore("Remove to run test")
60
+    @Test
61
     public void singleLine() {
61
     public void singleLine() {
62
         String input = "Single line.";
62
         String input = "Single line.";
63
 
63
 
77
         assertEquals(expected, transpose.transpose(input));
77
         assertEquals(expected, transpose.transpose(input));
78
     }
78
     }
79
 
79
 
80
-    @Test
81
     @Ignore("Remove to run test")
80
     @Ignore("Remove to run test")
81
+    @Test
82
     public void firstLineLongerThanSecond() {
82
     public void firstLineLongerThanSecond() {
83
         String input = "The fourth line.\n" +
83
         String input = "The fourth line.\n" +
84
                        "The fifth line.";
84
                        "The fifth line.";
103
         assertEquals(expected, transpose.transpose(input));
103
         assertEquals(expected, transpose.transpose(input));
104
     }
104
     }
105
 
105
 
106
-    @Test
107
     @Ignore("Remove to run test")
106
     @Ignore("Remove to run test")
107
+    @Test
108
     public void secondLineLongerThanFirst() {
108
     public void secondLineLongerThanFirst() {
109
         String input = "The first line.\n" +
109
         String input = "The first line.\n" +
110
                        "The second line.";
110
                        "The second line.";
129
         assertEquals(expected, transpose.transpose(input));
129
         assertEquals(expected, transpose.transpose(input));
130
     }
130
     }
131
 
131
 
132
-    @Test
133
     @Ignore("Remove to run test")
132
     @Ignore("Remove to run test")
133
+    @Test
134
     public void square() {
134
     public void square() {
135
         String input = "HEART\n" +
135
         String input = "HEART\n" +
136
                        "EMBER\n" +
136
                        "EMBER\n" +
147
         assertEquals(expected, transpose.transpose(input));
147
         assertEquals(expected, transpose.transpose(input));
148
     }
148
     }
149
 
149
 
150
-    @Test
151
     @Ignore("Remove to run test")
150
     @Ignore("Remove to run test")
151
+    @Test
152
     public void rectangle() {
152
     public void rectangle() {
153
         String input = "FRACTURE\n" +
153
         String input = "FRACTURE\n" +
154
                        "OUTLINED\n" +
154
                        "OUTLINED\n" +
167
         assertEquals(expected, transpose.transpose(input));
167
         assertEquals(expected, transpose.transpose(input));
168
     }
168
     }
169
 
169
 
170
-    @Test
171
     @Ignore("Remove to run test")
170
     @Ignore("Remove to run test")
171
+    @Test
172
     public void triangle() {
172
     public void triangle() {
173
         String input = "T\n" +
173
         String input = "T\n" +
174
                        "EE\n" +
174
                        "EE\n" +
187
         assertEquals(expected, transpose.transpose(input));
187
         assertEquals(expected, transpose.transpose(input));
188
     }
188
     }
189
 
189
 
190
-    @Test
191
     @Ignore("Remove to run test")
190
     @Ignore("Remove to run test")
191
+    @Test
192
     public void manyLines() {
192
     public void manyLines() {
193
         String input = "Chor. Two households, both alike in dignity,\n" +
193
         String input = "Chor. Two households, both alike in dignity,\n" +
194
                        "In fair Verona, where we lay our scene,\n" +
194
                        "In fair Verona, where we lay our scene,\n" +
261
 
261
 
262
         assertEquals(expected, transpose.transpose(input));
262
         assertEquals(expected, transpose.transpose(input));
263
     }
263
     }
264
-}
264
+}

+ 3
- 3
exercises/two-fer/src/test/java/TwoferTest.java Просмотреть файл

21
         assertEquals(expected, twofer.twofer(input));
21
         assertEquals(expected, twofer.twofer(input));
22
     }
22
     }
23
 
23
 
24
-    @Test
25
     @Ignore("Remove to run test")
24
     @Ignore("Remove to run test")
25
+    @Test
26
     public void aNameGiven() {
26
     public void aNameGiven() {
27
         String input = "Alice";
27
         String input = "Alice";
28
         String expected = "One for Alice, one for me.";
28
         String expected = "One for Alice, one for me.";
30
         assertEquals(expected, twofer.twofer(input));
30
         assertEquals(expected, twofer.twofer(input));
31
     }
31
     }
32
 
32
 
33
-    @Test
34
     @Ignore("Remove to run test")
33
     @Ignore("Remove to run test")
34
+    @Test
35
     public void anotherNameGiven() {
35
     public void anotherNameGiven() {
36
         String input = "Bob";
36
         String input = "Bob";
37
         String expected = "One for Bob, one for me.";
37
         String expected = "One for Bob, one for me.";
38
 
38
 
39
         assertEquals(expected, twofer.twofer(input));
39
         assertEquals(expected, twofer.twofer(input));
40
     }
40
     }
41
-}
41
+}