示例#1
0
        public void TestNoStraight()
        {
            var  cards  = MakeHand(Rank.Eight, Rank.Ten, Rank.Jack, Rank.Queen, Rank.King);
            bool result = HandUtil.TryGetStraightOrStraightFlush(cards, out HandType handType, out Rank rank);

            Assert.AreEqual(false, result);
        }
示例#2
0
        public void TestInterruptedHoldemStraight()
        {
            var  cards  = MakeHand(Rank.Two, Rank.Three, Rank.Five, Rank.Six, Rank.Seven, Rank.Eight, Rank.Nine);
            bool result = HandUtil.TryGetStraightOrStraightFlush(cards, out HandType handType, out Rank rank);

            Assert.AreEqual(true, result);
            Assert.AreEqual(HandType.Straight, handType);
            Assert.AreEqual(Rank.Nine, rank);
        }
示例#3
0
        public void TestHighAceStraight()
        {
            var  cards  = MakeHand(Rank.Ten, Rank.Jack, Rank.Queen, Rank.King, Rank.Ace);
            bool result = HandUtil.TryGetStraightOrStraightFlush(cards, out HandType handType, out Rank rank);

            Assert.AreEqual(true, result);
            Assert.AreEqual(HandType.Straight, handType);
            Assert.AreEqual(Rank.Ace, rank);
        }
示例#4
0
        public void TestStraightFlush()
        {
            var  cards  = MakeHand(alsoFlush: true, Rank.Nine, Rank.Ten, Rank.Jack, Rank.Queen, Rank.King);
            bool result = HandUtil.TryGetStraightOrStraightFlush(cards, out HandType handType, out Rank rank);

            Assert.AreEqual(true, result);
            Assert.AreEqual(HandType.StraightFlush, handType);
            Assert.AreEqual(Rank.King, rank);
        }
示例#5
0
        public void TestLowAceStraight()
        {
            var  cards  = MakeHand(Rank.Two, Rank.Three, Rank.Four, Rank.Five, Rank.Ace);
            bool result = HandUtil.TryGetStraightOrStraightFlush(cards, out HandType handType, out Rank rank);

            Assert.AreEqual(true, result);
            Assert.AreEqual(HandType.Straight, handType);
            Assert.AreEqual(Rank.Five, rank);
        }