public void FindFourOfAKind() { CardHand hand = CardHand.FromCards( new Card(CardSuits.Spades, CardRanks.Two), new Card(CardSuits.Clubs, CardRanks.Ace), new Card(CardSuits.Diamonds, CardRanks.Ace), new Card(CardSuits.Spades, CardRanks.Ace), new Card(CardSuits.Hearts, CardRanks.Ace)); HandEvaluator evaluator = new HandEvaluator(); BestHand bestHand = evaluator.FindBestHand(hand); Assert.AreEqual(VideoPokerHands.FourOfAKind, bestHand.HandType); }
public void FindRoyalFlush() { CardHand hand = CardHand.FromCards( new Card(CardSuits.Spades, CardRanks.Ace), new Card(CardSuits.Spades, CardRanks.King), new Card(CardSuits.Spades, CardRanks.Queen), new Card(CardSuits.Spades, CardRanks.Jack), new Card(CardSuits.Spades, CardRanks.Ten)); HandEvaluator evaluator = new HandEvaluator(); BestHand bestHand = evaluator.FindBestHand(hand); Assert.AreEqual(VideoPokerHands.RoyalFlush, bestHand.HandType); }
public void FindPairJacksOrBetter() { CardHand hand = CardHand.FromCards( new Card(CardSuits.Spades, CardRanks.Two), new Card(CardSuits.Spades, CardRanks.Three), new Card(CardSuits.Spades, CardRanks.Four), new Card(CardSuits.Spades, CardRanks.Ace), new Card(CardSuits.Hearts, CardRanks.Ace)); HandEvaluator evaluator = new HandEvaluator(); BestHand bestHand = evaluator.FindBestHand(hand); Assert.AreEqual(VideoPokerHands.JacksOrBetter, bestHand.HandType); }
public void FindStraightFlush() { CardHand hand = CardHand.FromCards( new Card(CardSuits.Spades, CardRanks.Two), new Card(CardSuits.Spades, CardRanks.Three), new Card(CardSuits.Spades, CardRanks.Four), new Card(CardSuits.Spades, CardRanks.Five), new Card(CardSuits.Spades, CardRanks.Six)); HandEvaluator evaluator = new HandEvaluator(); BestHand bestHand = evaluator.FindBestHand(hand); Assert.AreEqual(VideoPokerHands.StraightFlush, bestHand.HandType); }