assertTrue(hand1.compareTo(hand2) == 0);
}
public void testSevenCardHand() {
Hand hand1 = new Hand();
Hand hand2 = new Hand();
hand1 = hand1.add(testExactCard.getExactCard(Rank.FOUR, Suit.HEARTS));
hand1 = hand1.add(testExactCard.getExactCard(Rank.FIVE, Suit.SPADES));
hand1 = hand1.add(testExactCard.getExactCard(Rank.SEVEN, Suit.SPADES));
hand1 = hand1.add(testExactCard.getExactCard(Rank.SIX, Suit.SPADES));
hand1 = hand1.add(testExactCard.getExactCard(Rank.EIGHT, Suit.SPADES));
hand1 = hand1.add(testExactCard.getExactCard(Rank.ACE, Suit.DIAMONDS));
hand1 = hand1.add(testExactCard.getExactCard(Rank.NINE, Suit.SPADES));
assertTrue(hand1.getBestFive().getShortDescription().equals(
HandType.STRAIGHT_FLUSH.getDescription()));
hand2 = hand2.add(testExactCard.getExactCard(Rank.FOUR, Suit.HEARTS));
hand2 = hand2.add(testExactCard.getExactCard(Rank.FOUR, Suit.SPADES));
hand2 = hand2.add(testExactCard.getExactCard(Rank.FOUR, Suit.CLUBS));
hand2 = hand2.add(testExactCard.getExactCard(Rank.SIX, Suit.SPADES));
hand2 = hand2.add(testExactCard.getExactCard(Rank.EIGHT, Suit.SPADES));
hand2 = hand2.add(testExactCard.getExactCard(Rank.ACE, Suit.SPADES));
hand2 = hand2.add(testExactCard.getExactCard(Rank.KING, Suit.CLUBS));
assertTrue(hand2.getBestFive().getShortDescription().equals(
HandType.THREE_OF_A_KIND.getDescription()));
// test hand1>hand 2
assertTrue(hand1.compareTo(hand2) == 1);
// test hand1<hand 2
hand1 = new Hand();
hand1 = hand1.add(testExactCard.getExactCard(Rank.TWO, Suit.CLUBS));
hand1 = hand1.add(testExactCard.getExactCard(Rank.TWO, Suit.SPADES));
hand1 = hand1.add(testExactCard.getExactCard(Rank.SEVEN, Suit.HEARTS));
hand1 = hand1.add(testExactCard.getExactCard(Rank.SEVEN, Suit.DIAMONDS));
hand1 = hand1.add(testExactCard.getExactCard(Rank.EIGHT, Suit.SPADES));
hand1 = hand1.add(testExactCard.getExactCard(Rank.ACE, Suit.SPADES));
hand1 = hand1.add(testExactCard.getExactCard(Rank.ACE, Suit.HEARTS));
assertTrue(hand1.compareTo(hand2) == -1);
// test hand1==hand2
hand1 = new Hand();
hand1 = hand1.add(testExactCard.getExactCard(Rank.FOUR, Suit.HEARTS));
hand1 = hand1.add(testExactCard.getExactCard(Rank.FOUR, Suit.SPADES));
hand1 = hand1.add(testExactCard.getExactCard(Rank.FOUR, Suit.CLUBS));
hand1 = hand1.add(testExactCard.getExactCard(Rank.SEVEN, Suit.SPADES));
hand1 = hand1.add(testExactCard.getExactCard(Rank.EIGHT, Suit.SPADES));