Пример #1
0
        public void Cards_ShouldReturnCorrectResult(Hand hand, Card[] cards)
        {
            foreach (var card in cards)
            {
                hand.AddCard(card);
            }

            Assert.Equal(cards, hand.Cards);
        }
Пример #2
0
        public void GetValue_ShouldReturnCorrectResult_ForOneCard(Hand hand, Card card)
        {
            var expectedValue = BlackJack.CardValues[card.Rank];
            if (card.Rank == Ace)
            {
                expectedValue += BlackJack.AceIncrement;
            }

            hand.AddCard(card);

            Assert.Equal(expectedValue, hand.GetValue());
        }
Пример #3
0
 public BitmapImage GetImageForCard(Card card)
 {
     return _cardsImage;
 }
Пример #4
0
 public Rect GetViewboxForCard(Card card)
 {
     return _cardImagePositionProvider.GetCardRectangle(card).Normalize(_imageSize);
 }
Пример #5
0
 public void AddCard(Card card)
 {
     if (card == null) throw new ArgumentNullException(nameof(card));
     _cards.AddLast(card);
 }