Permalink
Browse files

test commit after i screwed up eclipse somehow

  • Loading branch information...
1 parent 0e85f34 commit ff88d85eb9273f91ba3c156c774c9db1f1638c35 @jbass86 committed Nov 27, 2013
Showing with 41 additions and 41 deletions.
  1. +41 −41 basic_poker_utils/src/jtj_holdem/tests/poker/PokerHandTests.java
@@ -24,7 +24,7 @@
@Test
public void testHighCard1(){
-
+
List<ICard> initialCards = new ArrayList<ICard>();
initialCards.add(new Card(ECardNumber.EIGHT, ECardSuit.SPADES));
initialCards.add(new Card(ECardNumber.TWO, ECardSuit.CLUBS));
@@ -38,18 +38,18 @@ public void testHighCard1(){
kickers.add(new Card(ECardNumber.NINE, ECardSuit.DIAMONDS));
kickers.add(new Card(ECardNumber.TEN, ECardSuit.HEARTS));
kickers.add(new Card(ECardNumber.SIX, ECardSuit.HEARTS));
-
-
+
+
PokerHand hand = PokerHandUtility.determineBestHand(initialCards);
-
+
Assert.assertEquals(hand.getHand(), EPokerHand.HIGH_CARD);
Assert.assertEquals(hand.getCards().get(0), new Card(ECardNumber.JACK, ECardSuit.SPADES));
verifyCardList(hand.getKickers(), kickers);
}
-
+
@Test
public void testHighCard2(){
-
+
List<ICard> initialCards = new ArrayList<ICard>();
initialCards.add(new Card(ECardNumber.ACE, ECardSuit.DIAMONDS));
initialCards.add(new Card(ECardNumber.TWO, ECardSuit.SPADES));
@@ -63,17 +63,17 @@ public void testHighCard2(){
kickers.add(new Card(ECardNumber.TEN, ECardSuit.HEARTS));
kickers.add(new Card(ECardNumber.NINE, ECardSuit.HEARTS));
kickers.add(new Card(ECardNumber.FOUR, ECardSuit.HEARTS));
-
+
PokerHand hand = PokerHandUtility.determineBestHand(initialCards);
-
+
Assert.assertEquals(hand.getHand(), EPokerHand.HIGH_CARD);
Assert.assertEquals(hand.getCards().get(0), new Card(ECardNumber.ACE, ECardSuit.DIAMONDS));
verifyCardList(hand.getKickers(), kickers);
}
-
+
@Test
public void highCardTest3(){
-
+
List<ICard> initialCards = new ArrayList<ICard>();
initialCards.add(new Card(ECardNumber.NINE, ECardSuit.DIAMONDS));
initialCards.add(new Card(ECardNumber.QUEEN, ECardSuit.SPADES));
@@ -82,27 +82,27 @@ public void highCardTest3(){
initialCards.add(new Card(ECardNumber.SEVEN, ECardSuit.CLUBS));
initialCards.add(new Card(ECardNumber.FIVE, ECardSuit.HEARTS));
initialCards.add(new Card(ECardNumber.ACE, ECardSuit.HEARTS));
-
-
-
+
+
+
List<ICard> handCards = new ArrayList<ICard>();
handCards.add(new Card(ECardNumber.ACE, ECardSuit.HEARTS));
List<ICard> kickers = new ArrayList<ICard>();
kickers.add(new Card(ECardNumber.KING, ECardSuit.HEARTS));
kickers.add(new Card(ECardNumber.QUEEN, ECardSuit.SPADES));
kickers.add(new Card(ECardNumber.NINE, ECardSuit.DIAMONDS));
kickers.add(new Card(ECardNumber.SEVEN, ECardSuit.CLUBS));
-
+
PokerHand hand = PokerHandUtility.determineBestHand(initialCards);
-
+
Assert.assertEquals(hand.getHand(), EPokerHand.HIGH_CARD);
verifyCardList(hand.getCards(), handCards);
verifyCardList(hand.getKickers(), kickers);
}
-
+
@Test
public void testOnePair1(){
-
+
List<ICard> initialCards = new ArrayList<ICard>();
initialCards.add(new Card(ECardNumber.ACE, ECardSuit.DIAMONDS));
initialCards.add(new Card(ECardNumber.TWO, ECardSuit.SPADES));
@@ -118,17 +118,17 @@ public void testOnePair1(){
kickers.add(new Card(ECardNumber.TEN, ECardSuit.HEARTS));
kickers.add(new Card(ECardNumber.NINE, ECardSuit.HEARTS));
kickers.add(new Card(ECardNumber.FOUR, ECardSuit.HEARTS));
-
+
PokerHand hand = PokerHandUtility.determineBestHand(initialCards);
-
+
Assert.assertEquals(hand.getHand(), EPokerHand.ONE_PAIR);
verifyCardList(hand.getCards(), handCards);
verifyCardList(hand.getKickers(), kickers);
}
-
+
@Test
public void testOnePair2(){
-
+
List<ICard> initialCards = new ArrayList<ICard>();
initialCards.add(new Card(ECardNumber.ACE, ECardSuit.DIAMONDS));
initialCards.add(new Card(ECardNumber.TWO, ECardSuit.SPADES));
@@ -144,17 +144,17 @@ public void testOnePair2(){
kickers.add(new Card(ECardNumber.ACE, ECardSuit.DIAMONDS));
kickers.add(new Card(ECardNumber.TEN, ECardSuit.HEARTS));
kickers.add(new Card(ECardNumber.NINE, ECardSuit.HEARTS));
-
+
PokerHand hand = PokerHandUtility.determineBestHand(initialCards);
-
+
Assert.assertEquals(hand.getHand(), EPokerHand.ONE_PAIR);
verifyCardList(hand.getCards(), handCards);
verifyCardList(hand.getKickers(), kickers);
}
-
+
@Test
public void testOnePair3(){
-
+
List<ICard> initialCards = new ArrayList<ICard>();
initialCards.add(new Card(ECardNumber.ACE, ECardSuit.DIAMONDS));
initialCards.add(new Card(ECardNumber.TWO, ECardSuit.SPADES));
@@ -170,17 +170,17 @@ public void testOnePair3(){
kickers.add(new Card(ECardNumber.ACE, ECardSuit.DIAMONDS));
kickers.add(new Card(ECardNumber.SIX, ECardSuit.CLUBS));
kickers.add(new Card(ECardNumber.NINE, ECardSuit.HEARTS));
-
+
PokerHand hand = PokerHandUtility.determineBestHand(initialCards);
-
+
Assert.assertEquals(hand.getHand(), EPokerHand.ONE_PAIR);
verifyCardList(hand.getCards(), handCards);
verifyCardList(hand.getKickers(), kickers);
}
-
+
@Test
public void testTwoPair1(){
-
+
List<ICard> initialCards = new ArrayList<ICard>();
initialCards.add(new Card(ECardNumber.ACE, ECardSuit.DIAMONDS));
initialCards.add(new Card(ECardNumber.TWO, ECardSuit.SPADES));
@@ -196,17 +196,17 @@ public void testTwoPair1(){
handCards.add(new Card(ECardNumber.ACE, ECardSuit.HEARTS));
List<ICard> kickers = new ArrayList<ICard>();
kickers.add(new Card(ECardNumber.NINE, ECardSuit.HEARTS));
-
+
PokerHand hand = PokerHandUtility.determineBestHand(initialCards);
-
+
Assert.assertEquals(hand.getHand(), EPokerHand.TWO_PAIR);
verifyCardList(hand.getCards(), handCards);
verifyCardList(hand.getKickers(), kickers);
}
-
+
@Test
public void testTwoPair2(){
-
+
List<ICard> initialCards = new ArrayList<ICard>();
initialCards.add(new Card(ECardNumber.SIX, ECardSuit.DIAMONDS));
initialCards.add(new Card(ECardNumber.TWO, ECardSuit.CLUBS));
@@ -222,17 +222,17 @@ public void testTwoPair2(){
handCards.add(new Card(ECardNumber.NINE, ECardSuit.SPADES));
List<ICard> kickers = new ArrayList<ICard>();
kickers.add(new Card(ECardNumber.TEN, ECardSuit.SPADES));
-
+
PokerHand hand = PokerHandUtility.determineBestHand(initialCards);
-
+
Assert.assertEquals(hand.getHand(), EPokerHand.TWO_PAIR);
verifyCardList(hand.getCards(), handCards);
verifyCardList(hand.getKickers(), kickers);
}
-
+
@Test
public void testTwoPair3(){
-
+
List<ICard> initialCards = new ArrayList<ICard>();
initialCards.add(new Card(ECardNumber.THREE, ECardSuit.SPADES));
initialCards.add(new Card(ECardNumber.KING, ECardSuit.HEARTS));
@@ -248,15 +248,15 @@ public void testTwoPair3(){
handCards.add(new Card(ECardNumber.KING, ECardSuit.SPADES));
List<ICard> kickers = new ArrayList<ICard>();
kickers.add(new Card(ECardNumber.ACE, ECardSuit.SPADES));
-
+
PokerHand hand = PokerHandUtility.determineBestHand(initialCards);
-
+
Assert.assertEquals(hand.getHand(), EPokerHand.TWO_PAIR);
verifyCardList(hand.getCards(), handCards);
verifyCardList(hand.getKickers(), kickers);
}
-
-
+
+
private static void verifyCardList(final List<ICard> pList1, final List<ICard> pList2){
for (ICard card : pList1){
Assert.assertEquals(pList2.contains(card), true);

0 comments on commit ff88d85

Please sign in to comment.