Example #1
0
        public void Test_HandKickerHigh()
        {
            Deck deck = new Deck();

            Card[] testCards = new Card[5];
            testCards[0] = new Card("2S");
            testCards[1] = new Card("3H");
            testCards[2] = new Card("4S");
            testCards[3] = new Card("5C");
            testCards[4] = new Card("6D");

            Hand hand = new Hand(testCards);

            hand.EvaluateHand();

            Assert.AreEqual(5, hand.GetKicker(1));
            Assert.AreEqual(4, hand.GetKicker(2));
            Assert.AreEqual(3, hand.GetKicker(3));
            Assert.AreEqual(2, hand.GetKicker(4));

            testCards[0] = new Card("JS");
            testCards[1] = new Card("10C");
            testCards[2] = new Card("8D");
            testCards[3] = new Card("3H");
            testCards[4] = new Card("2S");

            hand = new Hand(testCards);
            hand.EvaluateHand();

            Assert.AreEqual(10, hand.GetKicker(1));
            Assert.AreEqual(8, hand.GetKicker(2));
            Assert.AreEqual(3, hand.GetKicker(3));
            Assert.AreEqual(2, hand.GetKicker(4));

            testCards[0] = new Card("6S");
            testCards[1] = new Card("10H");
            testCards[2] = new Card("4D");
            testCards[3] = new Card("QC");
            testCards[4] = new Card("2D");

            hand = new Hand(testCards);
            hand.EvaluateHand();

            Assert.AreEqual(10, hand.GetKicker(1));
            Assert.AreEqual(6, hand.GetKicker(2));
            Assert.AreEqual(4, hand.GetKicker(3));
            Assert.AreEqual(2, hand.GetKicker(4));
        }
Example #2
0
        public void Test_HandKickerPair()
        {
            Deck deck = new Deck();

            Card[] testCards = new Card[5];
            testCards[0] = new Card("AS");
            testCards[1] = new Card("AD");
            testCards[2] = new Card("QC");
            testCards[3] = new Card("JS");
            testCards[4] = new Card("10H");

            Hand hand = new Hand(testCards);

            hand.EvaluateHand();

            Assert.AreEqual(12, hand.GetKicker(1));
            Assert.AreEqual(11, hand.GetKicker(2));
            Assert.AreEqual(10, hand.GetKicker(3));

            testCards[0] = new Card("JS");
            testCards[1] = new Card("10C");
            testCards[2] = new Card("8D");
            testCards[3] = new Card("QH");
            testCards[4] = new Card("QS");

            hand = new Hand(testCards);
            hand.EvaluateHand();

            Assert.AreEqual(11, hand.GetKicker(1));
            Assert.AreEqual(10, hand.GetKicker(2));
            Assert.AreEqual(8, hand.GetKicker(3));

            testCards[0] = new Card("6S");
            testCards[1] = new Card("10H");
            testCards[2] = new Card("4D");
            testCards[3] = new Card("6C");
            testCards[4] = new Card("2D");

            hand = new Hand(testCards);
            hand.EvaluateHand();

            Assert.AreEqual(10, hand.GetKicker(1));
            Assert.AreEqual(4, hand.GetKicker(2));
            Assert.AreEqual(2, hand.GetKicker(3));

            testCards[0] = new Card("6S");
            testCards[1] = new Card("10H");
            testCards[2] = new Card("4D");
            testCards[3] = new Card("6C");
            testCards[4] = new Card("10D");

            hand = new Hand(testCards);
            hand.EvaluateHand();

            Assert.AreEqual(6, hand.GetKicker(1));
            Assert.AreEqual(6, hand.GetKicker(2));
            Assert.AreEqual(4, hand.GetKicker(3));

            testCards[0] = new Card("QS");
            testCards[1] = new Card("KH");
            testCards[2] = new Card("7D");
            testCards[3] = new Card("7C");
            testCards[4] = new Card("KD");

            hand = new Hand(testCards);
            hand.EvaluateHand();

            Assert.AreEqual(12, hand.GetKicker(1));
            Assert.AreEqual(7, hand.GetKicker(2));
            Assert.AreEqual(7, hand.GetKicker(3));
        }
Example #3
0
        public void Test_HandKickerThreeOfAKind()
        {
            Deck deck = new Deck();

            Card[] testCards = new Card[5];
            testCards[0] = new Card("AS");
            testCards[1] = new Card("AH");
            testCards[2] = new Card("AC");
            testCards[3] = new Card("JS");
            testCards[4] = new Card("10D");

            Hand hand = new Hand(testCards);

            hand.EvaluateHand();

            Assert.AreEqual(11, hand.GetKicker(1));
            Assert.AreEqual(10, hand.GetKicker(2));

            testCards[0] = new Card("JS");
            testCards[1] = new Card("10C");
            testCards[2] = new Card("QD");
            testCards[3] = new Card("QH");
            testCards[4] = new Card("QS");

            hand = new Hand(testCards);
            hand.EvaluateHand();

            Assert.AreEqual(11, hand.GetKicker(1));
            Assert.AreEqual(10, hand.GetKicker(2));

            testCards[0] = new Card("6S");
            testCards[1] = new Card("10H");
            testCards[2] = new Card("4D");
            testCards[3] = new Card("6C");
            testCards[4] = new Card("6D");

            hand = new Hand(testCards);
            hand.EvaluateHand();

            Assert.AreEqual(10, hand.GetKicker(1));
            Assert.AreEqual(4, hand.GetKicker(2));

            testCards[0] = new Card("6S");
            testCards[1] = new Card("10H");
            testCards[2] = new Card("10D");
            testCards[3] = new Card("6C");
            testCards[4] = new Card("10D");

            hand = new Hand(testCards);
            hand.EvaluateHand();

            Assert.AreEqual(6, hand.GetKicker(1));
            Assert.AreEqual(6, hand.GetKicker(2));

            testCards[0] = new Card("KS");
            testCards[1] = new Card("KH");
            testCards[2] = new Card("QD");
            testCards[3] = new Card("AC");
            testCards[4] = new Card("KD");

            hand = new Hand(testCards);
            hand.EvaluateHand();

            Assert.AreEqual(14, hand.GetKicker(1));
            Assert.AreEqual(12, hand.GetKicker(2));
        }