Пример #1
0
        public void ShouldUseAceAsElevenWhenNeeded()
        {
            var hand = new Hand();
            hand.Add(new Card(CardRank.Ace, CardSuit.Diamond));
            hand.Add(new Card(CardRank.Ten, CardSuit.Heart));

            Assert.AreEqual(21, hand.TotalScore);
        }
Пример #2
0
        public void ShouldCalculateTotalScoreAccordingToCardsRanks()
        {
            var hand = new Hand();
            hand.Add(new Card(CardRank.Ten, CardSuit.Diamond));
            hand.Add(new Card(CardRank.Seven, CardSuit.Heart));

            Assert.AreEqual(17,hand.TotalScore);
        }
Пример #3
0
        public void ShoudAddCardsToHand()
        {
            var hand = new Hand();
            hand.Add(new Card(CardRank.Ten, CardSuit.Diamond));
            hand.Add(new Card(CardRank.Ten, CardSuit.Heart));

            Assert.AreEqual(2,hand.CardsCount);
        }
Пример #4
0
        public void ShouldRemoveAllCardsWhenClearHand()
        {
            var hand = new Hand();
            hand.Add(new Card(CardRank.Ten, CardSuit.Diamond));
            hand.Add(new Card(CardRank.Ten, CardSuit.Heart));

            hand.Clear();

            Assert.AreEqual(0, hand.CardsCount);
        }