Пример #1
0
        public void TestCardStackGetsRightNumberOfCardsFromPackage()
        {
            CardStack stack = new CardStack();

            // Get 5 cards 4 times
            stack.AddPackage(_package);
            stack.AddPackage(_package);
            stack.AddPackage(_package);
            stack.AddPackage(_package);

            Assert.AreEqual(20, stack.CardCollection.Count);
        }
Пример #2
0
        public void TestCardDeckGetsMaximumFourCards()
        {
            CardStack stack = new CardStack();
            CardDeck  deck  = new CardDeck();

            stack.AddPackage(_package);
            stack.AddPackage(_package);
            deck.AddCard(stack.CardCollection[0]);
            deck.AddCard(stack.CardCollection[1]);
            deck.AddCard(stack.CardCollection[2]);
            deck.AddCard(stack.CardCollection[3]);

            deck.RemoveCard(deck.CardCollection[2]);
            deck.AddCard(stack.CardCollection[4]);

            Assert.AreEqual(4, deck.CardCollection.Count);
        }
Пример #3
0
        public void TestCardStackGetsRightCardsFromPackage()
        {
            CardStack stack = new CardStack();

            stack.AddPackage(_package);

            Assert.AreEqual("Gandalf", stack.CardCollection[0].Name);
        }
Пример #4
0
 public void AddCardsToStack(CardPackage pack)
 {
     if (Coins > 0)
     {
         Stack.AddPackage(pack);
         Coins -= 5;
     }
 }
Пример #5
0
        public void TestCardStackGetsCardsFromPackage()
        {
            // Arrange
            CardStack stack = new CardStack();

            // Act
            stack.AddPackage(_package);

            // Assert
            Assert.IsNotNull(stack.CardCollection);
            Assert.AreEqual("Gandalf", stack.CardCollection[0].Name);
        }
Пример #6
0
        public void TestGetRandomCardFromDeck()
        {
            CardStack stack = new CardStack();
            CardDeck  deck  = new CardDeck();

            stack.AddPackage(_package);
            deck.AddCard(stack.CardCollection[0]);
            deck.AddCard(stack.CardCollection[1]);
            deck.AddCard(stack.CardCollection[2]);
            deck.AddCard(stack.CardCollection[3]);
            Card randomCard = deck.GetRandomCard();

            Assert.NotNull(randomCard);
            Console.WriteLine("The name of the random Monster/Spell is: " + randomCard.Name);
        }