Ejemplo n.º 1
0
        public void Blackjack_PlayerStatusToString_OutputsHandIfPlayerHasNotBusted()
        {
            Blackjack blackjack = new Blackjack();

            blackjack.ResetGame();
            List <Card> cards = new List <Card> {
                new Card(CardRank.KING, CardSuit.HEART), new Card(CardRank.TWO, CardSuit.DIAMOND)
            };

            blackjack.Player.Hand = new Hand(cards);

            string expected = $"\nYou are currently at 12";

            expected += $"\nwith the hand ['KING', 'HEART'], [2, 'DIAMOND']";

            string actual = blackjack.PlayerStatusToString();

            Assert.Equal(expected, actual);
        }
Ejemplo n.º 2
0
        public void Blackjack_PlayerStatusToString_OutputsBlackjackIfHandIsBlackJack()
        {
            Blackjack blackjack = new Blackjack();

            blackjack.ResetGame();
            //hand at 22
            List <Card> cards = new List <Card> {
                new Card(CardRank.KING, CardSuit.HEART), new Card(CardRank.ACE, CardSuit.DIAMOND)
            };

            blackjack.Player.Hand = new Hand(cards);

            string expected = "\nYou are currently at Blackjack!";

            expected += $"\nwith the hand ['KING', 'HEART'], ['ACE', 'DIAMOND']";

            string actual = blackjack.PlayerStatusToString();

            Assert.Equal(expected, actual);
        }