コード例 #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);
        }
コード例 #2
0
        public void InitializesDiscardDeck_ReturnsVoid()
        {
            // Arrange
            DiscardDeck discardDeck = new DiscardDeck();

            // Act

            // Assert
            Assert.AreEqual(0, discardDeck.getCount());
        }
コード例 #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());
        }
コード例 #4
0
 private static void updateDiscardDeckCount()
 {
     DiscardDeckCount = DiscardDeck.getCount().ToString();
 }