예제 #1
0
        public void WhenHandHasPair_ShouldReturnPairRank()
        {
            _hand.Add(new Card(Suit.Clubs, Value.Five));
            _hand.Add(new Card(Suit.Diamonds, Value.Five));

            Assert.AreEqual(HandRank.Pair, HandCategoriserChain.GetRank(_hand));
        }
예제 #2
0
        public void WhenHandHasThreeOfAKind_ShouldReturnThreeOfAKindRank()
        {
            _hand.Add(new Card(Suit.Clubs, Value.Five));
            _hand.Add(new Card(Suit.Diamonds, Value.Five));
            _hand.Add(new Card(Suit.Spades, Value.Five));

            Assert.AreEqual(HandRank.ThreeOfAKind, HandCategoriserChain.GetRank(_hand));
        }
예제 #3
0
        public void WhenHandHasTwoPair_ShouldReturnTwoPairRank()
        {
            _hand.Add(new Card(Suit.Clubs, Value.Five));
            _hand.Add(new Card(Suit.Diamonds, Value.Eight));
            _hand.Add(new Card(Suit.Spades, Value.Eight));
            _hand.Add(new Card(Suit.Hearts, Value.Five));

            Assert.AreEqual(HandRank.TwoPair, HandCategoriserChain.GetRank(_hand));
        }
예제 #4
0
        public void WhenHandHasFourOfAKind_ShouldReturnFourOfAKindRank()
        {
            _hand.Add(new Card(Suit.Clubs, Value.Two));
            _hand.Add(new Card(Suit.Diamonds, Value.Two));
            _hand.Add(new Card(Suit.Spades, Value.Two));
            _hand.Add(new Card(Suit.Hearts, Value.Two));

            Assert.AreEqual(HandRank.FourOfAKind, HandCategoriserChain.GetRank(_hand));
        }
예제 #5
0
        public void WhenHandHasStraight_ShouldReturnStraightRank()
        {
            _hand.Add(new Card(Suit.Clubs, Value.Two));
            _hand.Add(new Card(Suit.Diamonds, Value.Three));
            _hand.Add(new Card(Suit.Spades, Value.Four));
            _hand.Add(new Card(Suit.Spades, Value.Five));
            _hand.Add(new Card(Suit.Clubs, Value.Six));

            Assert.AreEqual(HandRank.Straight, HandCategoriserChain.GetRank(_hand));
        }
예제 #6
0
        public void WhenHandHasFlush_ShouldReturnFlushRank()
        {
            _hand.Add(new Card(Suit.Clubs, Value.Two));
            _hand.Add(new Card(Suit.Clubs, Value.Eight));
            _hand.Add(new Card(Suit.Clubs, Value.Ten));
            _hand.Add(new Card(Suit.Clubs, Value.Jack));
            _hand.Add(new Card(Suit.Clubs, Value.King));

            Assert.AreEqual(HandRank.Flush, HandCategoriserChain.GetRank(_hand));
        }
예제 #7
0
        public void WhenHandHasStraightFlush_ShouldReturnStraightFlushRank()
        {
            _hand.Add(new Card(Suit.Clubs, Value.Three));
            _hand.Add(new Card(Suit.Clubs, Value.Four));
            _hand.Add(new Card(Suit.Clubs, Value.Five));
            _hand.Add(new Card(Suit.Clubs, Value.Six));
            _hand.Add(new Card(Suit.Clubs, Value.Seven));

            Assert.AreEqual(HandRank.StraightFlush, HandCategoriserChain.GetRank(_hand));
        }
예제 #8
0
        public void WhenHandHasNoStraight_ShouldNotReturnStraightRank()
        {
            _hand.Add(new Card(Suit.Clubs, Value.Eight));
            _hand.Add(new Card(Suit.Diamonds, Value.Ten));
            _hand.Add(new Card(Suit.Spades, Value.Queen));
            _hand.Add(new Card(Suit.Spades, Value.Seven));
            _hand.Add(new Card(Suit.Clubs, Value.Ten));

            Assert.AreNotEqual(HandRank.Straight, HandCategoriserChain.GetRank(_hand));
        }
예제 #9
0
        public void WhenHandHasStraight_WithHighAce_ShouldReturnStraightRank()
        {
            _hand.Add(new Card(Suit.Clubs, Value.Ace));
            _hand.Add(new Card(Suit.Diamonds, Value.King));
            _hand.Add(new Card(Suit.Spades, Value.Queen));
            _hand.Add(new Card(Suit.Spades, Value.Jack));
            _hand.Add(new Card(Suit.Clubs, Value.Ten));

            Assert.AreEqual(HandRank.Straight, HandCategoriserChain.GetRank(_hand));
        }