Beispiel #1
0
        public void RemoveCard_InvalidCardProvided_FailureCardNotRemovedFromHand()
        {
            // Arrange
            var cardHand = new CardHand();

            // Act
            var removedCard = cardHand.RemoveCard(null);

            // Assert
            Assert.IsNull(removedCard);
        }
Beispiel #2
0
        public void RemoveCard_ValidCardProvided_SuccessCardRemovedCardFromHand()
        {
            // Arrange
            const int numCards = 4;
            Card addedCard = null;
            var deck = new DeckOfCards(true);
            var cardHand = new CardHand();

            for (var i = 0; i < numCards; i++)
            {
               addedCard = cardHand.AddCard(deck.GetCard(new GetNextCardStrategy()));
            }

            // Act
            var removedCard = cardHand.RemoveCard(addedCard);

            // Assert
            Assert.IsNotNull(removedCard);
            Assert.AreEqual(numCards - 1, cardHand.Count);
        }