/// <summary>
        /// Dealer reveal card and deals new card if handvalue is lower than 17
        /// </summary>
        private void DealerTurnAction()
        {
            var dealerHasHiddenCard = DealerCards.Any(x => x.HideCard == true);

            if (dealerHasHiddenCard)
            {
                RevealHiddenDealerCard();
            }
            while (_turnCommands.DealerDecision(_gameCommands.GetHandValue(DealerCards.ToList())))
            {
                DealerCards.Add(_turnCommands.Deal());
            }

            RaisePropertyChanged("CardsLeftInDeckCounter");
        }
Beispiel #2
0
        public void ValueFrom8AndKing()
        {
            var Card1 = new Card()
            {
                CardNumber = 1, Suit = Model.EnumTypes.SuitType.Clubs, Value = 8
            };
            var Card2 = new Card()
            {
                CardNumber = 1, Suit = Model.EnumTypes.SuitType.Clubs, Value = 13, Face = Model.EnumTypes.FaceType.King
            };

            var cards = new List <Card>();

            cards.Add(Card1);
            cards.Add(Card2);

            var expected = 18;

            var result = _gameCommands.GetHandValue(cards);

            Assert.AreEqual(expected, result);
        }