@@ -44,6 +44,15 @@ public void sameHighCards() {
44
44
.containsExactly (nextHighest3 );
45
45
}
46
46
47
+ @ Disabled ("Remove to run test" )
48
+ @ Test
49
+ public void winningWithLowestCard () {
50
+ String lowest2 = "2S 5H 6S 8D 7H" ;
51
+ String lowest3 = "3S 4D 6D 8C 7S" ;
52
+ assertThat (new Poker (Arrays .asList (lowest2 , lowest3 )).getBestHands ())
53
+ .containsExactly (lowest2 );
54
+ }
55
+
47
56
@ Disabled ("Remove to run test" )
48
57
@ Test
49
58
public void nothingVsOnePair () {
@@ -62,6 +71,15 @@ public void twoPairs() {
62
71
.containsExactly (pairOf4 );
63
72
}
64
73
74
+ @ Disabled ("Remove to run test" )
75
+ @ Test
76
+ public void samePair () {
77
+ String pairOf4Lower = "4H 4S AH JC 3D" ;
78
+ String pairOf4Higher = "4C 4D AS 5D 6C" ;
79
+ assertThat (new Poker (Arrays .asList (pairOf4Lower , pairOf4Higher )).getBestHands ())
80
+ .containsExactly (pairOf4Higher );
81
+ }
82
+
65
83
@ Disabled ("Remove to run test" )
66
84
@ Test
67
85
public void onePairVsDoublePair () {
@@ -98,6 +116,24 @@ public void identicallyRankedPairs() {
98
116
.containsExactly (kicker8 );
99
117
}
100
118
119
+ @ Disabled ("Remove to run test" )
120
+ @ Test
121
+ public void twoPairsAddingToSameValue () {
122
+ String doublePair6And3 = "6S 6H 3S 3H AS" ;
123
+ String doublePair7And2 = "7H 7S 2H 2S AC" ;
124
+ assertThat (new Poker (Arrays .asList (doublePair6And3 , doublePair7And2 )).getBestHands ())
125
+ .containsExactly (doublePair7And2 );
126
+ }
127
+
128
+ @ Disabled ("Remove to run test" )
129
+ @ Test
130
+ public void rankedByLargestPair () {
131
+ String doublePairs5And4 = "5C 2S 5S 4H 4C" ;
132
+ String doublePairs6And2 = "6S 2S 6H 7C 2C" ;
133
+ assertThat (new Poker (Arrays .asList (doublePairs5And4 , doublePairs6And2 )).getBestHands ())
134
+ .containsExactly (doublePairs6And2 );
135
+ }
136
+
101
137
@ Disabled ("Remove to run test" )
102
138
@ Test
103
139
public void doublePairVsThree () {
@@ -119,7 +155,7 @@ public void twoThrees() {
119
155
@ Disabled ("Remove to run test" )
120
156
@ Test
121
157
public void sameThreesMultipleDecks () {
122
- String remainingCard7 = "4S AH AS 7C AD" ;
158
+ String remainingCard7 = "5S AH AS 7C AD" ;
123
159
String remainingCard8 = "4S AH AS 8C AD" ;
124
160
assertThat (new Poker (Arrays .asList (remainingCard7 , remainingCard8 )).getBestHands ())
125
161
.containsExactly (remainingCard8 );
@@ -152,6 +188,15 @@ public void acesCanStartAStraight() {
152
188
.containsExactly (straightStartA );
153
189
}
154
190
191
+ @ Disabled ("Remove to run test" )
192
+ @ Test
193
+ public void acesCannotBeInMiddleOfStraight () {
194
+ String hand = "2C 3D 7H 5H 2S" ;
195
+ String straightMiddleA = "QS KH AC 2D 3S" ;
196
+ assertThat (new Poker (Arrays .asList (hand , straightMiddleA )).getBestHands ())
197
+ .containsExactly (hand );
198
+ }
199
+
155
200
@ Disabled ("Remove to run test" )
156
201
@ Test
157
202
public void twoStraights () {
@@ -181,11 +226,11 @@ public void straightVsFlush() {
181
226
182
227
@ Disabled ("Remove to run test" )
183
228
@ Test
184
- public void twoFlushes () {
185
- String flushTo8 = "4H 7H 8H 9H 6H" ;
186
- String flushTo7 = "2S 4S 5S 6S 7S" ;
187
- assertThat (new Poker (Arrays .asList (flushTo8 , flushTo7 )).getBestHands ())
188
- .containsExactly (flushTo8 );
229
+ public void twoFlushs () {
230
+ String flushTo9 = "2H 7H 8H 9H 6H" ;
231
+ String flushTo7 = "3S 5S 6S 7S 8S " ;
232
+ assertThat (new Poker (Arrays .asList (flushTo9 , flushTo7 )).getBestHands ())
233
+ .containsExactly (flushTo9 );
189
234
}
190
235
191
236
@ Disabled ("Remove to run test" )
@@ -251,6 +296,33 @@ public void squareVsStraightFlush() {
251
296
.containsExactly (straightFlushTo9 );
252
297
}
253
298
299
+ @ Disabled ("Remove to run test" )
300
+ @ Test
301
+ public void acesEndingStraightFlush () {
302
+ String hand = "KC AH AS AD AC" ;
303
+ String straightFlushEndingWithA = "10C JC QC KC AC" ;
304
+ assertThat (new Poker (Arrays .asList (hand , straightFlushEndingWithA )).getBestHands ())
305
+ .containsExactly (straightFlushEndingWithA );
306
+ }
307
+
308
+ @ Disabled ("Remove to run test" )
309
+ @ Test
310
+ public void acesStartingStraightFlush () {
311
+ String straightFlushStartingWithA = "4H AH 3H 2H 5H" ;
312
+ String hand = "KS AH AS AD AC" ;
313
+ assertThat (new Poker (Arrays .asList (straightFlushStartingWithA , hand )).getBestHands ())
314
+ .containsExactly (straightFlushStartingWithA );
315
+ }
316
+
317
+ @ Disabled ("Remove to run test" )
318
+ @ Test
319
+ public void acesCannotBeInMiddleOfStraightFlush () {
320
+ String straightFlushWithAInMiddle = "QH KH AH 2H 3H" ;
321
+ String hand = "2C AC QC 10C KC" ;
322
+ assertThat (new Poker (Arrays .asList (straightFlushWithAInMiddle , hand )).getBestHands ())
323
+ .containsExactly (hand );
324
+ }
325
+
254
326
@ Disabled ("Remove to run test" )
255
327
@ Test
256
328
public void twoStraightFlushes () {
@@ -259,4 +331,13 @@ public void twoStraightFlushes() {
259
331
assertThat (new Poker (Arrays .asList (straightFlushTo8 , straightFlushTo9 )).getBestHands ())
260
332
.containsExactly (straightFlushTo9 );
261
333
}
334
+
335
+ @ Disabled ("Remove to run test" )
336
+ @ Test
337
+ public void straightFlushTo5IsTheLowestScoring () {
338
+ String straightFlushTo6 = "2H 3H 4H 5H 6H" ;
339
+ String straightFlushTo5 = "4D AD 3D 2D 5D" ;
340
+ assertThat (new Poker (Arrays .asList (straightFlushTo6 , straightFlushTo5 )).getBestHands ())
341
+ .containsExactly (straightFlushTo6 );
342
+ }
262
343
}
0 commit comments