예제 #1
0
        public void TrumpInGetWinningPlayerTest()
        {
            var trick = new Trick(new Hand(Players, Deck)
            {
                SpadesHaveBeenBroken = true
            });

            trick.PlayCard(PlayerOne, new Card()
            {
                Rank = Rank.Seven, Suit = Suit.Diamonds
            });
            trick.PlayCard(PlayerTwo, new Card()
            {
                Rank = Rank.Ten, Suit = Suit.Diamonds
            });
            trick.PlayCard(PlayerThree, new Card()
            {
                Rank = Rank.Two, Suit = Suit.Spades
            });
            trick.PlayCard(PlayerFour, new Card()
            {
                Rank = Rank.Nine, Suit = Suit.Diamonds
            });

            var winner = trick.GetWinningPlayer();

            Assert.AreEqual(PlayerThree, winner);
        }
예제 #2
0
        public void AllTrumpsGetWinningPlayerTest()
        {
            var trick = new Trick(new Hand(Players, Deck)
            {
                SpadesHaveBeenBroken = true
            });

            trick.PlayCard(PlayerTwo, new Card()
            {
                Rank = Rank.King, Suit = Suit.Spades
            });
            trick.PlayCard(PlayerThree, new Card()
            {
                Rank = Rank.Queen, Suit = Suit.Spades
            });
            trick.PlayCard(PlayerFour, new Card()
            {
                Rank = Rank.Jack, Suit = Suit.Spades
            });
            trick.PlayCard(PlayerOne, new Card()
            {
                Rank = Rank.Ace, Suit = Suit.Spades
            });

            var winner = trick.GetWinningPlayer();

            Assert.AreEqual(PlayerOne, winner);
        }