Esempio n. 1
0
            public void Hearths()
            {
                // ARRANGE
                var game = Helper.HearthsRoyalFlush();

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

                // ASSERT
                Assert.IsTrue(result.Success());
                Assert.AreSame(game.Cards, result.UsedCards);
            }
Esempio n. 2
0
            public void Hearths()
            {
                // ARRANGE
                var game = Helper.HearthsRoyalFlush();

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

                // ASSERT
                Assert.IsTrue(result.Success());
                Assert.AreSame(game.Cards, result.UsedCards);
            }
Esempio n. 3
0
            public void NineInsteadOfTen()
            {
                var royalFlush = Helper.HearthsRoyalFlush();

                var game = GameBuilder.Game(royalFlush).SwapLastCardWith(
                    CardBuilder.Nine().Hearths());

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

                // ASSERT
                Assert.IsFalse(result.Success());
            }
Esempio n. 4
0
            public void Spades()
            {
                // ARRANGE
                var hearthsRoyalFlushCards = Helper.HearthsRoyalFlush().Cards;
                var cards = hearthsRoyalFlushCards.Select(
                    c =>
                        new Card(c.Rank, Suit.SPADES)).ToArray();

                var game = new Game(cards[0], cards[1], cards[2], cards[3], cards[4]);

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

                // ASSERT
                Assert.IsTrue(result.Success());
                Assert.AreSame(game.Cards, result.UsedCards);
            }
Esempio n. 5
0
            public void Diamonds()
            {
                // ARRANGE
                var hearthsRoyalFlushCards = Helper.HearthsRoyalFlush().Cards;
                var cards = hearthsRoyalFlushCards.Select(
                    c =>
                    new Card(c.Rank, Suit.DIAMONDS)).ToArray();

                var game = new Game(cards[0], cards[1], cards[2], cards[3], cards[4]);

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

                // ASSERT
                Assert.IsTrue(result.Success());
                Assert.AreSame(game.Cards, result.UsedCards);
            }
Esempio n. 6
0
            public void NineInsteadOfTen()
            {
                var royalFlush = Helper.HearthsRoyalFlush();

                var game = GameBuilder.Game(royalFlush).SwapLastCardWith(
                    CardBuilder.Nine().Hearths());

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

                // ASSERT
                Assert.IsFalse(result.Success());
            }