コード例 #1
0
            public void SpadesTwoToSix()
            {
                // ARRANGE
                var game = StraightFlushGameBuilder.Spades()
                           .From(Rank.TWO).To(Rank.SIX);

                // ACT
                var result = new StraightFlush().Evaluate(game);

                // ASSERT
                Assert.IsTrue(result.Success());
                Assert.AreSame(game.Cards, result.UsedCards);
            }
コード例 #2
0
            public void DiamondsFiveToNine()
            {
                // ARRANGE
                var game = StraightFlushGameBuilder.Diamonds()
                           .From(Rank.FIVE).To(Rank.NINE);

                // ACT
                var result = new StraightFlush().Evaluate(game);

                // ASSERT
                Assert.IsTrue(result.Success());
                Assert.AreSame(game.Cards, result.UsedCards);
            }
コード例 #3
0
        public void Straight()
        {
            // ARRANGE
            var cards = StraightFlushGameBuilder.Diamonds()
                        .From(Rank.TWO).To(Rank.SIX).Cards.ToArray();

            var game = new Game(
                cards[0],
                cards[1],
                cards[2],
                cards[3],
                new Card(cards[4].Rank, Suit.CLUBS));

            // ACT
            new GameEvaluator().Evaluate(game);

            // ASSERT
            Assert.AreEqual(GameCategory.STRAIGHT, game.Category);
        }
コード例 #4
0
            public void TwoToSix()
            {
                // ARRANGE
                var cards = StraightFlushGameBuilder.Spades()
                            .From(Rank.TWO).To(Rank.SIX).Cards.ToArray();

                var game = new Game(
                    cards[0],
                    cards[1],
                    cards[2],
                    cards[3],
                    new Card(cards[4].Rank, Suit.CLUBS));

                // ACT
                var result = new Straight().Evaluate(game);

                // ASSERT
                Assert.IsTrue(result.Success());
                Assert.AreSame(game.Cards, result.UsedCards);
            }
コード例 #5
0
            public void FiveToNine()
            {
                // ARRANGE
                var cards = StraightFlushGameBuilder.Diamonds()
                            .From(Rank.FIVE).To(Rank.NINE).Cards.ToArray();

                var game = new Game(
                    cards[0],
                    cards[1],
                    cards[2],
                    cards[3],
                    new Card(cards[4].Rank, Suit.CLUBS));

                // ACT
                var result = new Straight().Evaluate(game);

                // ASSERT
                Assert.IsTrue(result.Success());
                Assert.AreSame(game.Cards, result.UsedCards);
            }