|
@@ -1,239 +1,232 @@
|
1
|
|
-import org.junit.Ignore;
|
2
|
|
-import org.junit.Test;
|
3
|
|
-
|
4
|
|
-import java.util.Arrays;
|
5
|
|
-
|
6
|
|
-import static org.junit.Assert.assertEquals;
|
7
|
|
-
|
8
|
1
|
public class PokerTest {
|
9
|
|
- @Test
|
10
|
|
- public void oneHand() {
|
11
|
|
- String hand = "4S 5S 7H 8D JC";
|
12
|
|
- assertEquals(Arrays.asList(hand), new Poker(Arrays.asList(hand)).getBestHands());
|
13
|
|
- }
|
14
|
|
-
|
15
|
|
- @Ignore("Remove to run test")
|
16
|
|
- @Test
|
17
|
|
- public void highestCardWins() {
|
18
|
|
- String highest8 = "4D 5S 6S 8D 3C";
|
19
|
|
- String highest10 = "2S 4C 7S 9H 10H";
|
20
|
|
- String highestJ = "3S 4S 5D 6H JH";
|
21
|
|
- assertEquals(Arrays.asList(highestJ), new Poker(Arrays.asList(highest8, highest10, highestJ)).getBestHands());
|
22
|
|
- }
|
23
|
|
-
|
24
|
|
- @Ignore("Remove to run test")
|
25
|
|
- @Test
|
26
|
|
- public void tieHasMultipleWinners() {
|
27
|
|
- String highest8 = "4D 5S 6S 8D 3C";
|
28
|
|
- String highest10 = "2S 4C 7S 9H 10H";
|
29
|
|
- String highestJh = "3S 4S 5D 6H JH";
|
30
|
|
- String highestJd = "3H 4H 5C 6C JD";
|
31
|
|
- assertEquals(Arrays.asList(highestJh, highestJd),
|
32
|
|
- new Poker(Arrays.asList(highest8, highest10, highestJh, highestJd)).getBestHands());
|
33
|
|
- }
|
34
|
|
-
|
35
|
|
- @Ignore("Remove to run test")
|
36
|
|
- @Test
|
37
|
|
- public void sameHighCards() {
|
38
|
|
- String nextHighest3 = "3S 5H 6S 8D 7H";
|
39
|
|
- String nextHighest2 = "2S 5D 6D 8C 7S";
|
40
|
|
- assertEquals(Arrays.asList(nextHighest3), new Poker(Arrays.asList(nextHighest3, nextHighest2)).getBestHands());
|
41
|
|
- }
|
42
|
|
-
|
43
|
|
- @Ignore("Remove to run test")
|
44
|
|
- @Test
|
45
|
|
- public void nothingVsOnePair() {
|
46
|
|
- String nothing = "4S 5H 6C 8D KH";
|
47
|
|
- String pairOf4 = "2S 4H 6S 4D JH";
|
48
|
|
- assertEquals(Arrays.asList(pairOf4), new Poker(Arrays.asList(nothing, pairOf4)).getBestHands());
|
49
|
|
- }
|
50
|
|
-
|
51
|
|
- @Ignore("Remove to run test")
|
52
|
|
- @Test
|
53
|
|
- public void twoPairs() {
|
54
|
|
- String pairOf2 = "4S 2H 6S 2D JH";
|
55
|
|
- String pairOf4 = "2S 4H 6C 4D JD";
|
56
|
|
- assertEquals(Arrays.asList(pairOf4), new Poker(Arrays.asList(pairOf2, pairOf4)).getBestHands());
|
57
|
|
- }
|
58
|
|
-
|
59
|
|
- @Ignore("Remove to run test")
|
60
|
|
- @Test
|
61
|
|
- public void onePairVsDoublePair() {
|
62
|
|
- String pairOf8 = "2S 8H 6S 8D JH";
|
63
|
|
- String doublePair = "4S 5H 4C 8C 5H";
|
64
|
|
- assertEquals(Arrays.asList(doublePair), new Poker(Arrays.asList(pairOf8, doublePair)).getBestHands());
|
65
|
|
- }
|
66
|
|
-
|
67
|
|
- @Ignore("Remove to run test")
|
68
|
|
- @Test
|
69
|
|
- public void twoDoublePairs() {
|
70
|
|
- String doublePair2And8 = "2S 8H 2D 8D 3H";
|
71
|
|
- String doublePair4And5 = "4S 5H 4C 8S 5D";
|
72
|
|
- assertEquals(Arrays.asList(doublePair2And8),
|
73
|
|
- new Poker(Arrays.asList(doublePair2And8, doublePair4And5)).getBestHands());
|
74
|
|
- }
|
75
|
|
-
|
76
|
|
- @Ignore("Remove to run test")
|
77
|
|
- @Test
|
78
|
|
- public void sameHighestPair() {
|
79
|
|
- String doublePair2AndQ = "2S QS 2C QD JH";
|
80
|
|
- String doublePairJAndQ = "JD QH JS 8D QC";
|
81
|
|
- assertEquals(Arrays.asList(doublePairJAndQ),
|
82
|
|
- new Poker(Arrays.asList(doublePairJAndQ, doublePair2AndQ)).getBestHands());
|
83
|
|
- }
|
84
|
|
-
|
85
|
|
- @Ignore("Remove to run test")
|
86
|
|
- @Test
|
87
|
|
- public void identicallyRankedPairs() {
|
88
|
|
- String kicker8 = "JD QH JS 8D QC";
|
89
|
|
- String kicker2 = "JS QS JC 2D QD";
|
90
|
|
- assertEquals(Arrays.asList(kicker8), new Poker(Arrays.asList(kicker8, kicker2)).getBestHands());
|
91
|
|
- }
|
92
|
|
-
|
93
|
|
- @Ignore("Remove to run test")
|
94
|
|
- @Test
|
95
|
|
- public void doublePairVsThree() {
|
96
|
|
- String doublePair2And8 = "2S 8H 2H 8D JH";
|
97
|
|
- String threeOf4 = "4S 5H 4C 8S 4H";
|
98
|
|
- assertEquals(Arrays.asList(threeOf4), new Poker(Arrays.asList(doublePair2And8, threeOf4)).getBestHands());
|
99
|
|
- }
|
100
|
|
-
|
101
|
|
- @Ignore("Remove to run test")
|
102
|
|
- @Test
|
103
|
|
- public void twoThrees() {
|
104
|
|
- String threeOf2 = "2S 2H 2C 8D JH";
|
105
|
|
- String threeOf1 = "4S AH AS 8C AD";
|
106
|
|
- assertEquals(Arrays.asList(threeOf1), new Poker(Arrays.asList(threeOf2, threeOf1)).getBestHands());
|
107
|
|
- }
|
108
|
|
-
|
109
|
|
- @Ignore("Remove to run test")
|
110
|
|
- @Test
|
111
|
|
- public void sameThreesMultipleDecks() {
|
112
|
|
- String remainingCard7 = "4S AH AS 7C AD";
|
113
|
|
- String remainingCard8 = "4S AH AS 8C AD";
|
114
|
|
- assertEquals(Arrays.asList(remainingCard8),
|
115
|
|
- new Poker(Arrays.asList(remainingCard7, remainingCard8)).getBestHands());
|
116
|
|
- }
|
117
|
|
-
|
118
|
|
- @Ignore("Remove to run test")
|
119
|
|
- @Test
|
120
|
|
- public void threeVsStraight() {
|
121
|
|
- String threeOf4 = "4S 5H 4C 8D 4H";
|
122
|
|
- String straight = "3S 4D 2S 6D 5C";
|
123
|
|
- assertEquals(Arrays.asList(straight), new Poker(Arrays.asList(threeOf4, straight)).getBestHands());
|
124
|
|
- }
|
125
|
|
-
|
126
|
|
- @Ignore("Remove to run test")
|
127
|
|
- @Test
|
128
|
|
- public void AcesCanEndAStraight() {
|
129
|
|
- String hand = "4S 5H 4C 8D 4H";
|
130
|
|
- String straightEndsA = "10D JH QS KD AC";
|
131
|
|
- assertEquals(Arrays.asList(straightEndsA), new Poker(Arrays.asList(hand, straightEndsA)).getBestHands());
|
132
|
|
- }
|
133
|
|
-
|
134
|
|
- @Ignore("Remove to run test")
|
135
|
|
- @Test
|
136
|
|
- public void AcesCanStartAStraight() {
|
137
|
|
- String hand = "4S 5H 4C 8D 4H";
|
138
|
|
- String straightStartA = "4D AH 3S 2D 5C";
|
139
|
|
- assertEquals(Arrays.asList(straightStartA), new Poker(Arrays.asList(hand, straightStartA)).getBestHands());
|
140
|
|
- }
|
141
|
|
-
|
142
|
|
- @Ignore("Remove to run test")
|
143
|
|
- @Test
|
144
|
|
- public void twoStraights() {
|
145
|
|
- String straightTo8 = "4S 6C 7S 8D 5H";
|
146
|
|
- String straightTo9 = "5S 7H 8S 9D 6H";
|
147
|
|
- assertEquals(Arrays.asList(straightTo9), new Poker(Arrays.asList(straightTo8, straightTo9)).getBestHands());
|
148
|
|
- }
|
149
|
|
-
|
150
|
|
- @Ignore("Remove to run test")
|
151
|
|
- @Test
|
152
|
|
- public void theLowestStraightStartsWithAce() {
|
153
|
|
- String straight = "2H 3C 4D 5D 6H";
|
154
|
|
- String straightStartA = "4S AH 3S 2D 5H";
|
155
|
|
- assertEquals(Arrays.asList(straight), new Poker(Arrays.asList(straight, straightStartA)).getBestHands());
|
156
|
|
- }
|
157
|
|
-
|
158
|
|
- @Ignore("Remove to run test")
|
159
|
|
- @Test
|
160
|
|
- public void straightVsFlush() {
|
161
|
|
- String straightTo8 = "4C 6H 7D 8D 5H";
|
162
|
|
- String flushTo7 = "2S 4S 5S 6S 7S";
|
163
|
|
- assertEquals(Arrays.asList(flushTo7), new Poker(Arrays.asList(straightTo8, flushTo7)).getBestHands());
|
164
|
|
- }
|
165
|
|
-
|
166
|
|
- @Ignore("Remove to run test")
|
167
|
|
- @Test
|
168
|
|
- public void twoFlushes() {
|
169
|
|
- String flushTo8 = "4H 7H 8H 9H 6H";
|
170
|
|
- String flushTo7 = "2S 4S 5S 6S 7S";
|
171
|
|
- assertEquals(Arrays.asList(flushTo8), new Poker(Arrays.asList(flushTo8, flushTo7)).getBestHands());
|
172
|
|
- }
|
173
|
|
-
|
174
|
|
- @Ignore("Remove to run test")
|
175
|
|
- @Test
|
176
|
|
- public void flushVsFull() {
|
177
|
|
- String flushTo8 = "3H 6H 7H 8H 5H";
|
178
|
|
- String full = "4S 5H 4C 5D 4H";
|
179
|
|
- assertEquals(Arrays.asList(full), new Poker(Arrays.asList(full, flushTo8)).getBestHands());
|
180
|
|
- }
|
181
|
|
-
|
182
|
|
- @Ignore("Remove to run test")
|
183
|
|
- @Test
|
184
|
|
- public void twoFulls() {
|
185
|
|
- String fullOf4By9 = "4H 4S 4D 9S 9D";
|
186
|
|
- String fullOf5By8 = "5H 5S 5D 8S 8D";
|
187
|
|
- assertEquals(Arrays.asList(fullOf5By8), new Poker(Arrays.asList(fullOf4By9, fullOf5By8)).getBestHands());
|
188
|
|
- }
|
189
|
|
-
|
190
|
|
- @Ignore("Remove to run test")
|
191
|
|
- @Test
|
192
|
|
- public void twoFullssameThripletMultipleDecks() {
|
193
|
|
- String fullOf5By9 = "5H 5S 5D 9S 9D";
|
194
|
|
- String fullOf5By8 = "5H 5S 5D 8S 8D";
|
195
|
|
- assertEquals(Arrays.asList(fullOf5By9), new Poker(Arrays.asList(fullOf5By9, fullOf5By8)).getBestHands());
|
196
|
|
- }
|
197
|
|
-
|
198
|
|
- @Ignore("Remove to run test")
|
199
|
|
- @Test
|
200
|
|
- public void fullVsSquare() {
|
201
|
|
- String full = "4S 5H 4D 5D 4H";
|
202
|
|
- String squareOf3 = "3S 3H 2S 3D 3C";
|
203
|
|
- assertEquals(Arrays.asList(squareOf3), new Poker(Arrays.asList(full, squareOf3)).getBestHands());
|
204
|
|
- }
|
205
|
|
-
|
206
|
|
- @Ignore("Remove to run test")
|
207
|
|
- @Test
|
208
|
|
- public void twoSquares() {
|
209
|
|
- String squareOf2 = "2S 2H 2C 8D 2H";
|
210
|
|
- String squareOf5 = "4S 5H 5S 5D 5C";
|
211
|
|
- assertEquals(Arrays.asList(squareOf5), new Poker(Arrays.asList(squareOf2, squareOf5)).getBestHands());
|
212
|
|
- }
|
213
|
|
-
|
214
|
|
- @Ignore("Remove to run test")
|
215
|
|
- @Test
|
216
|
|
- public void sameSquaresMultipleDecks() {
|
217
|
|
- String kicker2 = "3S 3H 2S 3D 3C";
|
218
|
|
- String kicker4 = "3S 3H 4S 3D 3C";
|
219
|
|
- assertEquals(Arrays.asList(kicker4), new Poker(Arrays.asList(kicker2, kicker4)).getBestHands());
|
220
|
|
- }
|
221
|
|
-
|
222
|
|
- @Ignore("Remove to run test")
|
223
|
|
- @Test
|
224
|
|
- public void squareVsStraightFlush() {
|
225
|
|
- String squareOf5 = "4S 5H 5S 5D 5C";
|
226
|
|
- String straightFlushTo9 = "7S 8S 9S 6S 10S";
|
227
|
|
- assertEquals(Arrays.asList(straightFlushTo9),
|
228
|
|
- new Poker(Arrays.asList(squareOf5, straightFlushTo9)).getBestHands());
|
229
|
|
- }
|
230
|
|
-
|
231
|
|
- @Ignore("Remove to run test")
|
232
|
|
- @Test
|
233
|
|
- public void twoStraightFlushes() {
|
234
|
|
- String straightFlushTo8 = "4H 6H 7H 8H 5H";
|
235
|
|
- String straightFlushTo9 = "5S 7S 8S 9S 6S";
|
236
|
|
- assertEquals(Arrays.asList(straightFlushTo9),
|
237
|
|
- new Poker(Arrays.asList(straightFlushTo8, straightFlushTo9)).getBestHands());
|
238
|
|
- }
|
|
2
|
+ @Test
|
|
3
|
+ public void oneHand() {
|
|
4
|
+ String hand = "4S 5S 7H 8D JC";
|
|
5
|
+ assertEquals(Arrays.asList(hand), new Poker(Arrays.asList(hand)).getBestHands());
|
|
6
|
+ }
|
|
7
|
+
|
|
8
|
+ @Ignore("Remove to run test")
|
|
9
|
+ @Test
|
|
10
|
+ public void highestCardWins() {
|
|
11
|
+ String highest8 = "4D 5S 6S 8D 3C";
|
|
12
|
+ String highest10 = "2S 4C 7S 9H 10H";
|
|
13
|
+ String highestJ = "3S 4S 5D 6H JH";
|
|
14
|
+ assertEquals(Arrays.asList(highestJ), new Poker(Arrays.asList(highest8, highest10, highestJ)).getBestHands());
|
|
15
|
+ }
|
|
16
|
+
|
|
17
|
+ @Ignore("Remove to run test")
|
|
18
|
+ @Test
|
|
19
|
+ public void tieHasMultipleWinners() {
|
|
20
|
+ String highest8 = "4D 5S 6S 8D 3C";
|
|
21
|
+ String highest10 = "2S 4C 7S 9H 10H";
|
|
22
|
+ String highestJh = "3S 4S 5D 6H JH";
|
|
23
|
+ String highestJd = "3H 4H 5C 6C JD";
|
|
24
|
+ assertEquals(Arrays.asList(highestJh, highestJd),
|
|
25
|
+ new Poker(Arrays.asList(highest8, highest10, highestJh, highestJd)).getBestHands());
|
|
26
|
+ }
|
|
27
|
+
|
|
28
|
+ @Ignore("Remove to run test")
|
|
29
|
+ @Test
|
|
30
|
+ public void sameHighCards() {
|
|
31
|
+ String nextHighest3 = "3S 5H 6S 8D 7H";
|
|
32
|
+ String nextHighest2 = "2S 5D 6D 8C 7S";
|
|
33
|
+ assertEquals(Arrays.asList(nextHighest3), new Poker(Arrays.asList(nextHighest3, nextHighest2)).getBestHands());
|
|
34
|
+ }
|
|
35
|
+
|
|
36
|
+ @Ignore("Remove to run test")
|
|
37
|
+ @Test
|
|
38
|
+ public void nothingVsOnePair() {
|
|
39
|
+ String nothing = "4S 5H 6C 8D KH";
|
|
40
|
+ String pairOf4 = "2S 4H 6S 4D JH";
|
|
41
|
+ assertEquals(Arrays.asList(pairOf4), new Poker(Arrays.asList(nothing, pairOf4)).getBestHands());
|
|
42
|
+ }
|
|
43
|
+
|
|
44
|
+ @Ignore("Remove to run test")
|
|
45
|
+ @Test
|
|
46
|
+ public void twoPairs() {
|
|
47
|
+ String pairOf2 = "4S 2H 6S 2D JH";
|
|
48
|
+ String pairOf4 = "2S 4H 6C 4D JD";
|
|
49
|
+ assertEquals(Arrays.asList(pairOf4), new Poker(Arrays.asList(pairOf2, pairOf4)).getBestHands());
|
|
50
|
+ }
|
|
51
|
+
|
|
52
|
+ @Ignore("Remove to run test")
|
|
53
|
+ @Test
|
|
54
|
+ public void onePairVsDoublePair() {
|
|
55
|
+ String pairOf8 = "2S 8H 6S 8D JH";
|
|
56
|
+ String doublePair = "4S 5H 4C 8C 5C";
|
|
57
|
+ assertEquals(Arrays.asList(doublePair), new Poker(Arrays.asList(pairOf8, doublePair)).getBestHands());
|
|
58
|
+ }
|
|
59
|
+
|
|
60
|
+ @Ignore("Remove to run test")
|
|
61
|
+ @Test
|
|
62
|
+ public void twoDoublePairs() {
|
|
63
|
+ String doublePair2And8 = "2S 8H 2D 8D 3H";
|
|
64
|
+ String doublePair4And5 = "4S 5H 4C 8S 5D";
|
|
65
|
+ assertEquals(Arrays.asList(doublePair2And8),
|
|
66
|
+ new Poker(Arrays.asList(doublePair2And8, doublePair4And5)).getBestHands());
|
|
67
|
+ }
|
|
68
|
+
|
|
69
|
+ @Ignore("Remove to run test")
|
|
70
|
+ @Test
|
|
71
|
+ public void sameHighestPair() {
|
|
72
|
+ String doublePair2AndQ = "2S QS 2C QD JH";
|
|
73
|
+ String doublePairJAndQ = "JD QH JS 8D QC";
|
|
74
|
+ assertEquals(Arrays.asList(doublePairJAndQ),
|
|
75
|
+ new Poker(Arrays.asList(doublePairJAndQ, doublePair2AndQ)).getBestHands());
|
|
76
|
+ }
|
|
77
|
+
|
|
78
|
+ @Ignore("Remove to run test")
|
|
79
|
+ @Test
|
|
80
|
+ public void identicallyRankedPairs() {
|
|
81
|
+ String kicker8 = "JD QH JS 8D QC";
|
|
82
|
+ String kicker2 = "JS QS JC 2D QD";
|
|
83
|
+ assertEquals(Arrays.asList(kicker8), new Poker(Arrays.asList(kicker8, kicker2)).getBestHands());
|
|
84
|
+ }
|
|
85
|
+
|
|
86
|
+ @Ignore("Remove to run test")
|
|
87
|
+ @Test
|
|
88
|
+ public void doublePairVsThree() {
|
|
89
|
+ String doublePair2And8 = "2S 8H 2H 8D JH";
|
|
90
|
+ String threeOf4 = "4S 5H 4C 8S 4H";
|
|
91
|
+ assertEquals(Collections.singletonList(threeOf4), new Poker(Arrays.asList(doublePair2And8, threeOf4)).getBestHands());
|
|
92
|
+ }
|
|
93
|
+
|
|
94
|
+ @Ignore("Remove to run test")
|
|
95
|
+ @Test
|
|
96
|
+ public void twoThrees() {
|
|
97
|
+ String threeOf2 = "2S 2H 2C 8D JH";
|
|
98
|
+ String threeOf1 = "4S AH AS 8C AD";
|
|
99
|
+ assertEquals(Arrays.asList(threeOf1), new Poker(Arrays.asList(threeOf2, threeOf1)).getBestHands());
|
|
100
|
+ }
|
|
101
|
+
|
|
102
|
+ @Ignore("Remove to run test")
|
|
103
|
+ @Test
|
|
104
|
+ public void sameThreesMultipleDecks() {
|
|
105
|
+ String remainingCard7 = "4S AH AS 7C AD";
|
|
106
|
+ String remainingCard8 = "4S AH AS 8C AD";
|
|
107
|
+ assertEquals(Arrays.asList(remainingCard8),
|
|
108
|
+ new Poker(Arrays.asList(remainingCard7, remainingCard8)).getBestHands());
|
|
109
|
+ }
|
|
110
|
+
|
|
111
|
+ @Ignore("Remove to run test")
|
|
112
|
+ @Test
|
|
113
|
+ public void threeVsStraight() {
|
|
114
|
+ String threeOf4 = "4S 5H 4C 8D 4H";
|
|
115
|
+ String straight = "3S 4D 2S 6D 5C";
|
|
116
|
+ assertEquals(Arrays.asList(straight), new Poker(Arrays.asList(threeOf4, straight)).getBestHands());
|
|
117
|
+ }
|
|
118
|
+
|
|
119
|
+ @Ignore("Remove to run test")
|
|
120
|
+ @Test
|
|
121
|
+ public void AcesCanEndAStraight() {
|
|
122
|
+ String hand = "4S 5H 4C 8D 4H";
|
|
123
|
+ String straightEndsA = "10D JH QS KD AC";
|
|
124
|
+ assertEquals(Arrays.asList(straightEndsA), new Poker(Arrays.asList(hand, straightEndsA)).getBestHands());
|
|
125
|
+ }
|
|
126
|
+
|
|
127
|
+ @Ignore("Remove to run test")
|
|
128
|
+ @Test
|
|
129
|
+ public void AcesCanStartAStraight() {
|
|
130
|
+ String hand = "4S 5H 4C 8D 4H";
|
|
131
|
+ String straightStartA = "4D AH 3S 2D 5C";
|
|
132
|
+ assertEquals(Arrays.asList(straightStartA), new Poker(Arrays.asList(hand, straightStartA)).getBestHands());
|
|
133
|
+ }
|
|
134
|
+
|
|
135
|
+ @Ignore("Remove to run test")
|
|
136
|
+ @Test
|
|
137
|
+ public void twoStraights() {
|
|
138
|
+ String straightTo8 = "4S 6C 7S 8D 5H";
|
|
139
|
+ String straightTo9 = "5S 7H 8S 9D 6H";
|
|
140
|
+ assertEquals(Arrays.asList(straightTo9), new Poker(Arrays.asList(straightTo8, straightTo9)).getBestHands());
|
|
141
|
+ }
|
|
142
|
+
|
|
143
|
+ @Ignore("Remove to run test")
|
|
144
|
+ @Test
|
|
145
|
+ public void theLowestStraightStartsWithAce() {
|
|
146
|
+ String straight = "2H 3C 4D 5D 6H";
|
|
147
|
+ String straightStartA = "4S AH 3S 2D 5H";
|
|
148
|
+ assertEquals(Arrays.asList(straight), new Poker(Arrays.asList(straight, straightStartA)).getBestHands());
|
|
149
|
+ }
|
|
150
|
+
|
|
151
|
+ @Ignore("Remove to run test")
|
|
152
|
+ @Test
|
|
153
|
+ public void straightVsFlush() {
|
|
154
|
+ String straightTo8 = "4C 6H 7D 8D 5H";
|
|
155
|
+ String flushTo7 = "2S 4S 5S 6S 7S";
|
|
156
|
+ assertEquals(Arrays.asList(flushTo7), new Poker(Arrays.asList(straightTo8, flushTo7)).getBestHands());
|
|
157
|
+ }
|
|
158
|
+
|
|
159
|
+ @Ignore("Remove to run test")
|
|
160
|
+ @Test
|
|
161
|
+ public void twoFlushes() {
|
|
162
|
+ String flushTo8 = "4H 7H 8H 9H 6H";
|
|
163
|
+ String flushTo7 = "2S 4S 5S 6S 7S";
|
|
164
|
+ assertEquals(Arrays.asList(flushTo8), new Poker(Arrays.asList(flushTo8, flushTo7)).getBestHands());
|
|
165
|
+ }
|
|
166
|
+
|
|
167
|
+ @Ignore("Remove to run test")
|
|
168
|
+ @Test
|
|
169
|
+ public void flushVsFull() {
|
|
170
|
+ String flushTo8 = "3H 6H 7H 8H 5H";
|
|
171
|
+ String full = "4S 5H 4C 5D 4H";
|
|
172
|
+ assertEquals(Arrays.asList(full), new Poker(Arrays.asList(full, flushTo8)).getBestHands());
|
|
173
|
+ }
|
|
174
|
+
|
|
175
|
+ @Ignore("Remove to run test")
|
|
176
|
+ @Test
|
|
177
|
+ public void twoFulls() {
|
|
178
|
+ String fullOf4By9 = "4H 4S 4D 9S 9D";
|
|
179
|
+ String fullOf5By8 = "5H 5S 5D 8S 8D";
|
|
180
|
+ assertEquals(Arrays.asList(fullOf5By8), new Poker(Arrays.asList(fullOf4By9, fullOf5By8)).getBestHands());
|
|
181
|
+ }
|
|
182
|
+
|
|
183
|
+ @Ignore("Remove to run test")
|
|
184
|
+ @Test
|
|
185
|
+ public void twoFullssameThripletMultipleDecks() {
|
|
186
|
+ String fullOf5By9 = "5H 5S 5D 9S 9D";
|
|
187
|
+ String fullOf5By8 = "5H 5S 5D 8S 8D";
|
|
188
|
+ assertEquals(Arrays.asList(fullOf5By9), new Poker(Arrays.asList(fullOf5By9, fullOf5By8)).getBestHands());
|
|
189
|
+ }
|
|
190
|
+
|
|
191
|
+ @Ignore("Remove to run test")
|
|
192
|
+ @Test
|
|
193
|
+ public void fullVsSquare() {
|
|
194
|
+ String full = "4S 5H 4D 5D 4H";
|
|
195
|
+ String squareOf3 = "3S 3H 2S 3D 3C";
|
|
196
|
+ assertEquals(Arrays.asList(squareOf3), new Poker(Arrays.asList(full, squareOf3)).getBestHands());
|
|
197
|
+ }
|
|
198
|
+
|
|
199
|
+ @Ignore("Remove to run test")
|
|
200
|
+ @Test
|
|
201
|
+ public void twoSquares() {
|
|
202
|
+ String squareOf2 = "2S 2H 2C 8D 2D";
|
|
203
|
+ String squareOf5 = "4S 5H 5S 5D 5C";
|
|
204
|
+ assertEquals(Arrays.asList(squareOf5), new Poker(Arrays.asList(squareOf2, squareOf5)).getBestHands());
|
|
205
|
+ }
|
|
206
|
+
|
|
207
|
+ @Ignore("Remove to run test")
|
|
208
|
+ @Test
|
|
209
|
+ public void sameSquaresMultipleDecks() {
|
|
210
|
+ String kicker2 = "3S 3H 2S 3D 3C";
|
|
211
|
+ String kicker4 = "3S 3H 4S 3D 3C";
|
|
212
|
+ assertEquals(Arrays.asList(kicker4), new Poker(Arrays.asList(kicker2, kicker4)).getBestHands());
|
|
213
|
+ }
|
|
214
|
+
|
|
215
|
+ @Ignore("Remove to run test")
|
|
216
|
+ @Test
|
|
217
|
+ public void squareVsStraightFlush() {
|
|
218
|
+ String squareOf5 = "4S 5H 5S 5D 5C";
|
|
219
|
+ String straightFlushTo9 = "7S 8S 9S 6S 10S";
|
|
220
|
+ assertEquals(Arrays.asList(straightFlushTo9),
|
|
221
|
+ new Poker(Arrays.asList(squareOf5, straightFlushTo9)).getBestHands());
|
|
222
|
+ }
|
|
223
|
+
|
|
224
|
+ @Ignore("Remove to run test")
|
|
225
|
+ @Test
|
|
226
|
+ public void twoStraightFlushes() {
|
|
227
|
+ String straightFlushTo8 = "4H 6H 7H 8H 5H";
|
|
228
|
+ String straightFlushTo9 = "5S 7S 8S 9S 6S";
|
|
229
|
+ assertEquals(Arrays.asList(straightFlushTo9),
|
|
230
|
+ new Poker(Arrays.asList(straightFlushTo8, straightFlushTo9)).getBestHands());
|
|
231
|
+ }
|
239
|
232
|
}
|