예제 #1
0
        public void Blackjack_DealFirstHand_DealerIsDealtTwoCards()  //Do I need this? essential a duplicate of test at line 24
        //Given
        {
            Blackjack blackjack = new Blackjack();

            blackjack.ResetGame();
            blackjack.DealFirstHand(blackjack.Dealer);

            Assert.True(blackjack.Dealer.Hand.Cards.Count == 2);
        }
예제 #2
0
        public void BlackJack_playerCanStay_HasStayed()
        {
            Blackjack blackjack = new Blackjack();

            blackjack.ResetGame();
            blackjack.DealFirstHand(blackjack.Player);
            blackjack.Stay();

            Assert.True(blackjack.Player.HasStayed);
        }
예제 #3
0
        public void Blackjack_DealFirstHand_PlayerIsDealtTwoCards()
        {
            //Given
            Blackjack blackjack = new Blackjack();

            blackjack.ResetGame();
            blackjack.DealFirstHand(blackjack.Player); //discuss how I changed method signature

            Assert.True(blackjack.Player.Hand.Cards.Count == 2);
        }
예제 #4
0
        public void BlackJack_Drawcard_Dealer_AddsCardToDealerHand()
        {
            //Given
            Blackjack blackjack = new Blackjack();

            blackjack.ResetGame();
            blackjack.DealFirstHand(blackjack.Dealer);
            blackjack.DrawCard(blackjack.Dealer);

            //When
            const int expected = 3;
            int       actual   = blackjack.Dealer.Hand.Cards.Count;

            //Then
            Assert.Equal(expected, actual);
        }
예제 #5
0
        public void BlackJack_playerCanStay_DrawsNoCards()
        {
            //Given
            Blackjack blackjack = new Blackjack();

            blackjack.ResetGame();
            blackjack.DealFirstHand(blackjack.Player);
            blackjack.Stay();

            //When
            const int expected = 2;
            int       actual   = blackjack.Player.Hand.Cards.Count;

            //Then
            Assert.Equal(expected, actual);
        }