Example #1
0
  @Test
  public void testComparison() {

    assertTrue("Hand 1 is weaker than hand 2", testHand1.compareTo(testHand3) < 0);
    assertTrue("Hand 2 is stronger than hand 3", testHand2.compareTo(testHand3) > 0);
    assertTrue("Hand 3 is weaker than hand 4", testHand3.compareTo(testHand4) < 0);
    assertTrue("Hand 4 is equivalent to hand 5", testHand4.compareTo(testHand5) == 0);
  }
Example #2
0
  @Test
  public void testValue() {
    assertEquals("Hand 1 is a PLAIN FLUSH", testHand1.getStrength(), Hand.Strength.FLUSH);

    assertEquals("Hand 2 is a ROYAL FLUSH", testHand2.getStrength(), Hand.Strength.ROYAL_FLUSH);

    assertEquals(
        "Hand 3 is a STRAIGHT FLUSH", testHand3.getStrength(), Hand.Strength.STRAIGHT_FLUSH);
  }