Example #1
0
            public void FivesFullOfQueens()
            {
                var acesFullOfKings = AcesFullOfKingsGame();

                // ARRANGE
                var aces = acesFullOfKings.Cards.Where(
                    c =>
                        Rank.ACE == c.Rank);

                var kings = acesFullOfKings.Cards.Where(
                    c =>
                        Rank.KING == c.Rank);

                var fives = aces.Select(
                    c =>
                        new Card(Rank.FIVE, c.Suit)).ToArray();

                var queens = kings.Select(
                    c =>
                        new Card(Rank.QUEEN, c.Suit)).ToArray();

                var game = new Game(
                    fives[0],
                    queens[0],
                    fives[1],
                    queens[1],
                    fives[2]);

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

                // ASSERT
                Assert.IsTrue(result.Success());
                Assert.AreSame(game.Cards, result.UsedCards);
            }
Example #2
0
            public void AcesFullOfKings()
            {
                // ARRANGE
                var game = AcesFullOfKingsGame();

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

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