Bladeren bron

Merge pull request #679 from exercism/ignore-order

Standardize order of test annotations
FridaTveit 9 jaren geleden
bovenliggende
commit
21c61521a3

+ 1
- 1
POLICIES.md Bestand weergeven

@@ -48,7 +48,7 @@ References: [[1](https://github.com/exercism/java/issues/178)]
48 48
 
49 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 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 Bestand weergeven

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

+ 36
- 36
exercises/custom-set/src/test/java/CustomSetTest.java Bestand weergeven

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

+ 4
- 4
exercises/palindrome-products/src/test/java/PalindromeCalculatorTest.java Bestand weergeven

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

+ 18
- 18
exercises/poker/src/test/java/PokerTest.java Bestand weergeven

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

+ 6
- 6
exercises/pythagorean-triplet/src/test/java/PythagoreanTripletTest.java Bestand weergeven

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

+ 10
- 10
exercises/series/src/test/java/SeriesTest.java Bestand weergeven

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

+ 11
- 11
exercises/sum-of-multiples/src/test/java/SumOfMultiplesTest.java Bestand weergeven

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

+ 11
- 11
exercises/transpose/src/test/java/TransposeTest.java Bestand weergeven

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

+ 3
- 3
exercises/two-fer/src/test/java/TwoferTest.java Bestand weergeven

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