示例#1
0
        public void PokerHandConstructorTest()
        {
            PokerHand h = new PokerHand("AS KS QS JS TS");

            Assert.AreEqual("TS JS QS KS AS", h.ToString());
            Assert.IsTrue(h.IsRoyalFlush());
            Assert.IsTrue(h.GetHighCard() == Card.ACE);
            Assert.AreEqual(PokerHand.ROYAL_FLUSH, h.GetRank());

            h = new PokerHand("AS 9S QS JS TS");
            Assert.AreEqual("9S TS JS QS AS", h.ToString());
            Assert.IsTrue(h.GetHighCard() == Card.ACE);
            Assert.AreEqual(PokerHand.FLUSH, h.GetRank());

            h = new PokerHand("5H 5C 6S 7S KD");
            Assert.AreEqual("5H 5C 6S 7S KD", h.ToString());
            Assert.IsTrue(h.GetHighCard() == 5);
            Assert.AreEqual(PokerHand.PAIR, h.GetRank());

            h = new PokerHand("3D 6D 7D TD QD");
            Assert.AreEqual("3D 6D 7D TD QD", h.ToString());
            Assert.IsTrue(h.GetHighCard() == Card.QUEEN);
            Assert.AreEqual(PokerHand.FLUSH, h.GetRank());
        }