Exemplo n.º 1
0
        public void HandTypeDetection()
        {
            testHand.Cards.Add(new Card()
            {
                Rank = CardRank.Nine, Suit = CardSuit.Clubs
            });
            testHand.Cards.Add(new Card()
            {
                Rank = CardRank.Nine, Suit = CardSuit.Diamonds
            });
            testHand.Cards.Add(new Card()
            {
                Rank = CardRank.Nine, Suit = CardSuit.Hearts
            });
            testHand.Cards.Add(new Card()
            {
                Rank = CardRank.Queen, Suit = CardSuit.Clubs
            });
            testHand.Cards.Add(new Card()
            {
                Rank = CardRank.Queen, Suit = CardSuit.Diamonds
            });

            PokerHandType?detectedHandType = testHand.DetermineHandType();

            Assert.IsNotNull(detectedHandType, "Detected hand type result was null.");
            Assert.IsTrue(detectedHandType.HasValue, "Detected hand type had not value.");
            Assert.AreEqual(
                PokerHandType.FullHouse,
                detectedHandType.Value,
                "Full house not detected during generic hand detection test.");
        }