public void It_should_identify_two_pairs() { var hand = new PokerHand(twoPairs); Assert.IsTrue(hand.IsTwoPairs); }
public void It_should_say_flush_is_better_than_straight() { var straightHand = new PokerHand(straight); var flushHand = new PokerHand(flush); Assert.IsTrue(flushHand.BetterThan(straightHand)); Assert.IsFalse(straightHand.BetterThan(flushHand)); }
public void It_should_identify_pair() { PokerHand hand = new PokerHand(pair1); Assert.IsTrue(hand.IsPair); Assert.IsFalse(hand.IsThreeOfaKind); }
public void It_should_identify_three_of_a_kind() { var pokerHand = new PokerHand(threeOfaKind); Assert.IsTrue(pokerHand.IsThreeOfaKind); Assert.IsFalse(pokerHand.IsPair); }
public void It_should_say_threeofakind_is_better_than_pair() { PokerHand pair = new PokerHand(this.pair1); var three = new PokerHand(threeOfaKind); Assert.IsTrue(three.BetterThan(pair)); Assert.IsFalse(pair.BetterThan(three)); }
public void It_should_identify_full_house() { var hand = new PokerHand(fullHouse); Assert.IsTrue(hand.IsFullHouse); }
public void It_should_say_straight_is_better_than_threeofakind() { var three = new PokerHand(threeOfaKind); var straightHand = new PokerHand(straight); Assert.IsTrue(straightHand.BetterThan(three)); Assert.IsFalse(three.BetterThan(straightHand)); }
public void It_should_say_straight_flush_is_better_than_foure_of_a_kind() { var fourOfaKindHand = new PokerHand(fourOfaKind); var straightFlushHand = new PokerHand(straightFlush); Assert.IsTrue(straightFlushHand.BetterThan(fourOfaKindHand)); Assert.IsFalse(fourOfaKindHand.BetterThan(straightFlushHand)); }
public void It_should_say_full_house_is_better_than_flush() { var flushHand = new PokerHand(flush); var fullHouseHand = new PokerHand(fullHouse); Assert.IsTrue(fullHouseHand.BetterThan(flushHand)); Assert.IsFalse(flushHand.BetterThan(fullHouseHand)); }
public void It_should_say_four_of_a_kind_is_better_than_full_house() { var fullHouseHand = new PokerHand(fullHouse); var fourOfaKindHand = new PokerHand(fourOfaKind); Assert.IsTrue(fourOfaKindHand.BetterThan(fullHouseHand)); Assert.IsFalse(fullHouseHand.BetterThan(fourOfaKindHand)); }
public bool BetterThan(PokerHand otherHand) { var betterRank = otherHand.IsFourOfAKind && IsStraightFlush || otherHand.IsFullHouse && IsFourOfAKind || otherHand.IsFlush && IsFullHouse || otherHand.IsStraight && IsFlush || otherHand.IsThreeOfaKind && IsStraight || otherHand.IsPair && IsThreeOfaKind; return betterRank; }