Exemplo n.º 1
0
        public void HouseDrawFail()
        {
            BlackJackController blackJack = new BlackJackController(1);
            Deck deck       = new Deck();
            Deck playerHand = new Deck(true);
            Deck houseHand  = new Deck(true);

            Card TwoSpade   = new Card(Suit.SPADES, Face.TWO);
            Card SevenHeart = new Card(Suit.HEARTS, Face.SEVEN);

            playerHand.Return(TwoSpade);
            playerHand.Return(SevenHeart);

            Card SevenClub  = new Card(Suit.CLUBS, Face.SEVEN);
            Card QueenSpade = new Card(Suit.SPADES, Face.QUEEN);

            houseHand.Return(SevenClub);
            houseHand.Return(QueenSpade);

            bool drawHouse = false;

            if (blackJack.GetHandValue(playerHand) == blackJack.GetHandValue(houseHand) &&
                blackJack.GetHandValue(playerHand) < 21)
            {
                drawHouse = true;
            }

            Assert.IsFalse(drawHouse);
        }
Exemplo n.º 2
0
        public void BeatHouseFail()
        {
            BlackJackController blackJack = new BlackJackController(1);
            Deck deck       = new Deck();
            Deck playerHand = new Deck(true);
            Deck houseHand  = new Deck(true);

            Card AceSpade  = new Card(Suit.SPADES, Face.ACE);
            Card KingSpade = new Card(Suit.SPADES, Face.KING);

            houseHand.Return(AceSpade);
            houseHand.Return(KingSpade);

            Card SevenClub = new Card(Suit.CLUBS, Face.SEVEN);
            Card TwoHeart  = new Card(Suit.HEARTS, Face.TWO);

            playerHand.Return(SevenClub);
            playerHand.Return(TwoHeart);

            bool beatHouse = false;

            if (blackJack.GetHandValue(playerHand) > blackJack.GetHandValue(houseHand) &&
                blackJack.GetHandValue(playerHand) < 21)
            {
                beatHouse = true;
            }

            Assert.IsFalse(beatHouse);
        }
Exemplo n.º 3
0
        public void GetHandValueFail()
        {
            BlackJackController blackJack = new BlackJackController(1);
            Deck deck       = new Deck();
            Deck playerHand = new Deck(true);

            Card king = new Card(Suit.CLUBS, Face.KING);
            Card Ace  = new Card(Suit.CLUBS, Face.ACE);

            playerHand.Return(king);
            playerHand.Return(Ace);

            bool IsValue = false;

            if (blackJack.GetHandValue(playerHand) == 18)
            {
                IsValue = true;
            }

            Assert.IsFalse(IsValue);
        }
Exemplo n.º 4
0
        public void GetHandValuePass()
        {
            BlackJackController blackJack = new BlackJackController(1);
            Deck deck       = new Deck();
            Deck playerHand = new Deck(true);

            Card king  = new Card(Suit.CLUBS, Face.KING);
            Card Eight = new Card(Suit.CLUBS, Face.EIGHT);

            playerHand.Return(king);
            playerHand.Return(Eight);

            bool IsValue = false;

            if (blackJack.GetHandValue(playerHand) == 18)
            {
                IsValue = true;
            }

            Assert.IsTrue(IsValue);
        }