Ejemplo n.º 1
0
        public void DiscardDeckIsEmptied_ReturnsListOfCards()
        {
            // Arrange
            const int NumberOfCards = 5;
            Card      card          = new Card(
                new Hashtable()
            {
                { "display", "A" },
                { "value", 11 },
                { "alternativeValue", 1 },
            },
                new Hashtable()
            {
                { "suit", "Hearts" },
                { "color", "Red" },
            }
                );
            DiscardDeck discardDeck = new DiscardDeck();
            List <Card> emptiedCards;

            // Act
            for (int i = 0; i < NumberOfCards; i++)
            {
                discardDeck.addCard(card);
            }
            emptiedCards = discardDeck.clearDiscardPile();

            // Assert
            Assert.AreEqual(0, discardDeck.getCount());
            Assert.AreEqual(NumberOfCards, emptiedCards.Count);
        }
Ejemplo n.º 2
0
        public void InitializesDiscardDeck_ReturnsVoid()
        {
            // Arrange
            DiscardDeck discardDeck = new DiscardDeck();

            // Act

            // Assert
            Assert.AreEqual(0, discardDeck.getCount());
        }
Ejemplo n.º 3
0
        public void AddsToDiscardDeck_ReturnsVoid()
        {
            // Arrange
            Card card = new Card(
                new Hashtable()
            {
                { "display", "A" },
                { "value", 11 },
                { "alternativeValue", 1 },
            },
                new Hashtable()
            {
                { "suit", "Hearts" },
                { "color", "Red" },
            }
                );
            DiscardDeck discardDeck = new DiscardDeck();

            // Act
            discardDeck.addCard(card);

            // Assert
            Assert.AreEqual(1, discardDeck.getCount());
        }
Ejemplo n.º 4
0
 private static void updateDiscardDeckCount()
 {
     DiscardDeckCount = DiscardDeck.getCount().ToString();
 }