Skip to content
Snippets Groups Projects
Commit 277d747a authored by Siyu Lin's avatar Siyu Lin
Browse files

Added checkGetBestHand and cards array resorted

parent fc5fcc7b
No related branches found
No related tags found
No related merge requests found
......@@ -63,7 +63,7 @@ public class EvaluatorTest {
@Test
public void checkAllCardsSubsetCanSatisfy(){
IEvaluator onePairEval = new OnePairEvaluator(3, 4);
Card[] cards =Card.createArray("2c, 2d, 3h");
Card[] cards =Card.createArray("3h, 2c, 2d,");
String msg = ("The newly constructed cards[2c, 2d, 3h]'s subset should satisfy the one pair evaluator");
assertEquals(msg, true, onePairEval.canSubsetSatisfy(cards));
}
......@@ -87,4 +87,13 @@ public class EvaluatorTest {
String msg = ("The newly constructed cards[2c, 2d, 3h]'s subset should satisfy the one pair evaluator");
assertEquals(msg, "One Pair (3) [6s 6c: Ah Kh]", hand.toString());
}
@Test
public void checkGetBestHand(){
IEvaluator onePairEval = new OnePairEvaluator(3, 4);
Card[] cards =Card.createArray("6s, Jh, Ah, 10h, 6h, Js, 6c, Kh, Qh");
Arrays.sort(cards);
String msg = ("The newly constructed cards[6s, Jh, Ah, 10h, 6h, Js, 6c, Kh, Qh]'s best hand should be One Pair (3) [Js Jh: Ah Kh]");
assertEquals(msg, "One Pair (3) [Js Jh: Ah Kh]", onePairEval.getBestHand(cards).toString());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment