Пример #1
0
        public void HandWithoutAcesShouldTotalNormal()
        {
            var hand = new Hand();
            hand.Cards.Add(new Card(CardValue.Eight));
            hand.Cards.Add(new Card(CardValue.Seven));

            int val = hand.Evaluate();
            Assert.AreEqual(15, val);
        }
Пример #2
0
        public void AceShouldBeElevenIfWouldntBust()
        {
            var hand = new Hand();
            hand.Cards.Add(new Card(CardValue.Ace));
            hand.Cards.Add(new Card(CardValue.Eight));

            int val = hand.Evaluate();
            Assert.AreEqual(19, val);
        }
Пример #3
0
        public void AdditionalAcesShouldEvaluateToOneIfWouldBust()
        {
            var hand = new Hand();
            hand.Cards.Add(new Card(CardValue.Ace));
            hand.Cards.Add(new Card(CardValue.Ace));
            hand.Cards.Add(new Card(CardValue.Eight));

            int val = hand.Evaluate();
            Assert.AreEqual(20, val);
        }
Пример #4
0
        public void AceShouldBeOneIfWouldBust()
        {
            var hand = new Hand();
            hand.Cards.Add(new Card(CardValue.Ace));
            hand.Cards.Add(new Card(CardValue.King));
            hand.Cards.Add(new Card(CardValue.Jack));

            int val = hand.Evaluate();
            Assert.AreEqual(21, val);
        }