@@ -44,6 +44,15 @@ public void sameHighCards() {
4444 .containsExactly (nextHighest3 );
4545 }
4646
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+
4756 @ Disabled ("Remove to run test" )
4857 @ Test
4958 public void nothingVsOnePair () {
@@ -62,6 +71,15 @@ public void twoPairs() {
6271 .containsExactly (pairOf4 );
6372 }
6473
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+
6583 @ Disabled ("Remove to run test" )
6684 @ Test
6785 public void onePairVsDoublePair () {
@@ -98,6 +116,24 @@ public void identicallyRankedPairs() {
98116 .containsExactly (kicker8 );
99117 }
100118
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+
101137 @ Disabled ("Remove to run test" )
102138 @ Test
103139 public void doublePairVsThree () {
@@ -119,7 +155,7 @@ public void twoThrees() {
119155 @ Disabled ("Remove to run test" )
120156 @ Test
121157 public void sameThreesMultipleDecks () {
122- String remainingCard7 = "4S AH AS 7C AD" ;
158+ String remainingCard7 = "5S AH AS 7C AD" ;
123159 String remainingCard8 = "4S AH AS 8C AD" ;
124160 assertThat (new Poker (Arrays .asList (remainingCard7 , remainingCard8 )).getBestHands ())
125161 .containsExactly (remainingCard8 );
@@ -152,6 +188,15 @@ public void acesCanStartAStraight() {
152188 .containsExactly (straightStartA );
153189 }
154190
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+
155200 @ Disabled ("Remove to run test" )
156201 @ Test
157202 public void twoStraights () {
@@ -181,11 +226,11 @@ public void straightVsFlush() {
181226
182227 @ Disabled ("Remove to run test" )
183228 @ 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 );
189234 }
190235
191236 @ Disabled ("Remove to run test" )
@@ -251,6 +296,33 @@ public void squareVsStraightFlush() {
251296 .containsExactly (straightFlushTo9 );
252297 }
253298
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+
254326 @ Disabled ("Remove to run test" )
255327 @ Test
256328 public void twoStraightFlushes () {
@@ -259,4 +331,13 @@ public void twoStraightFlushes() {
259331 assertThat (new Poker (Arrays .asList (straightFlushTo8 , straightFlushTo9 )).getBestHands ())
260332 .containsExactly (straightFlushTo9 );
261333 }
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+ }
262343}
0 commit comments