Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
 public Player()
 {
     MyHand = new Hand();
 }