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); }
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); }
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); }
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); }
public Player() { MyHand = new Hand(); }