Beispiel #1
0
  @Test
  public void ThreeOfAKind_3() {
    Deck d = new Deck();
    Hand h = new Hand();
    h.AddCardToHand(new Card(eSuit.CLUBS, eRank.TEN, 0));
    h.AddCardToHand(new Card(eSuit.DIAMONDS, eRank.TEN, 0));
    h.AddCardToHand(new Card(eSuit.SPADES, eRank.TEN, 0));
    h.AddCardToHand(new Card(eSuit.HEARTS, eRank.TWO, 0));
    h.AddCardToHand(new Card(eSuit.CLUBS, eRank.THREE, 0));
    h.EvalHand();

    assertTrue(h.getHandStrength() == eHandStrength.ThreeOfAKind.getHandStrength());
    assertTrue(h.getHighPairStrength() == eRank.TEN.getRank());
    assertTrue(h.getLowPairStrength() == 0);
    assertTrue(h.getKicker().size() == 2);

    Card c1 = h.getKicker().get(eCardNo.FirstCard.getCardNo());
    Card c2 = h.getKicker().get(eCardNo.SecondCard.getCardNo());

    //	Check to see if the first kicker is a THREE
    assertTrue(c1.getRank().getRank() == eRank.THREE.getRank());

    //	Check to see if the second kicker is a TWO
    assertTrue(c2.getRank().getRank() == eRank.TWO.getRank());
  }
Beispiel #2
0
  @Test
  public void ThreeOfAKind_1() {
    Deck d = new Deck();
    Hand h = new Hand();
    h.AddCardToHand(new Card(eSuit.CLUBS, eRank.TEN, 0));
    h.AddCardToHand(new Card(eSuit.DIAMONDS, eRank.TEN, 0));
    h.AddCardToHand(new Card(eSuit.SPADES, eRank.TEN, 0));
    h.AddCardToHand(new Card(eSuit.HEARTS, eRank.FOUR, 0));
    h.AddCardToHand(new Card(eSuit.CLUBS, eRank.NINE, 0));
    h.EvalHand();

    assertTrue(h.getHandStrength() == eHandStrength.ThreeOfAKind.getHandStrength());
    assertTrue(h.getHighPairStrength() == eRank.TEN.getRank());
    assertTrue(h.getLowPairStrength() == 0);
    assertTrue(h.getKicker().size() == 2);
  }