Exemplo n.º 1
0
        public void FourOfAKindFound()
        {
            var checker = new FourOfAKindChecker();
            var value   = checker.HandValue(_hands[7]);

            value.Should().Be(7.1202m);
        }
Exemplo n.º 2
0
        public void FourOfAKindNoWildFound()
        {
            var checker = new FourOfAKindChecker();
            var value   = checker.HandValue(_hands[15]);

            value.Should().Be(7.0407m);
        }
Exemplo n.º 3
0
        public void FourOfAKindNotFound()
        {
            var checker = new FourOfAKindChecker();

            for (var i = 0; i < 9; i++)
            {
                if (i != 7)
                {
                    var value = checker.HandValue(_hands[i]);
                    value.Should().Be(0, _hands[i].Select(c => c.ToString()).Aggregate((a, b) => a + " " + b));
                }
            }
        }
Exemplo n.º 4
0
        public void FourOfAKindNotFound()
        {
            var checker = new FourOfAKindChecker();

            for (var i = 0; i < _hands.Count; i++)
            {
                if (!new[] { 7, 13, 14, 15, 16 }.Contains(i))
                {
                    var value = checker.HandValue(_hands[i]);
                    value.Should().Be(0, _hands[i].Select(c => c.ToString()).Aggregate((a, b) => a + " " + b));
                }
            }
        }
        public static PokerCombinationChecker GetChecker()
        {
            var highCard = new HighCardChecker();
            var onePair  = new OnePairChecker()
                           .SuccessiveHand(highCard);
            var twoPair = new TwoPairChecker()
                          .SuccessiveHand(onePair);
            var threeOfAKind = new ThreeOfAKindChecker()
                               .SuccessiveHand(twoPair);
            var straight = new StraightChecker()
                           .SuccessiveHand(threeOfAKind);
            var flush = new FlushChecker()
                        .SuccessiveHand(straight);
            var fullHouse = new FullHouseChecker()
                            .SuccessiveHand(flush);
            var fourOfAKind = new FourOfAKindChecker()
                              .SuccessiveHand(fullHouse);
            var straightFlush = new StraightFlushChecker()
                                .SuccessiveHand(fourOfAKind);

            return(straightFlush);
        }
Exemplo n.º 6
0
        static PokerCombinationChecker GetChecker()
        {
            var highCard = new HighCardChecker();
            var onePair = new OnePairChecker()
                .SuccessiveHand(highCard);
            var twoPair = new TwoPairChecker()
                .SuccessiveHand(onePair);
            var threeOfAKind = new ThreeOfAKindChecker()
                .SuccessiveHand(twoPair);
            var straight = new StraightChecker()
                .SuccessiveHand(threeOfAKind);
            var flush = new FlushChecker()
                .SuccessiveHand(straight);
            var fullHouse = new FullHouseChecker()
                .SuccessiveHand(flush);
            var fourOfAKind = new FourOfAKindChecker()
                .SuccessiveHand(fullHouse);
            var straightFlush = new StraightFlushChecker()
                .SuccessiveHand(fourOfAKind);

            return straightFlush;
        }