Example #1
0
        public void FromEmptyDeck()
        {
            ICardDeck deck = new GenericDeck();
            var session = deck.StartNewSession();

            Assert.AreEqual(0, session.CardsRemaining, " Should have no cards remaining.");
        }
        public void InsertCards()
        {
            ICard toInsert = new ZombicideCard("TestCard", "1 Walker", "2 Walker", "2 Walker", "2 Walker");
            ICardDeck deck = new GenericDeck();
            deck.InsertCard(toInsert);
            Assert.AreEqual(1, deck.CardsInDeck, "1 Card Inserted");

            deck.InsertCard(toInsert);
            Assert.AreEqual(2, deck.CardsInDeck, "2 Card Inserted, possible to insert card more than once");
        }
Example #3
0
        public void ModifyinDeckAfterCreation()
        {
            ICardDeck deck = new GenericDeck();
            ICard toInsert = new ZombicideCard("TestCard", "1 Walker", "2 Walker", "2 Walker", "2 Walker");
            deck.InsertCard(toInsert);

            var session = deck.StartNewSession();

            Assert.AreEqual(1, session.CardsRemaining, " Should have 1 cards remaining.");

            deck.InsertCard(toInsert);
            Assert.AreEqual(1, session.CardsRemaining, "Modifing deck should not modify sesson.");
        }
Example #4
0
        public void DrawCard()
        {
            ICardDeck deck = new GenericDeck();
            ICard toInsert = new ZombicideCard("TestCard", "1 Walker", "2 Walker", "2 Walker", "2 Walker");
            deck.InsertCard(toInsert);

            var session = deck.StartNewSession();
            Assert.AreEqual(1, session.CardsRemaining, " Should have 1 cards remaining.");

            ICard drawnCard = session.DrawCard();
            Assert.IsNotNull(drawnCard);
            Assert.AreEqual(toInsert, drawnCard);
            Assert.AreEqual(0, session.CardsRemaining);

            drawnCard = session.DrawCard();
            Assert.IsNull(drawnCard);
        }
 public void InsertCardsNull()
 {
     ICardDeck deck = new GenericDeck();
     deck.InsertCard(null);
     Assert.AreEqual(0, deck.CardsInDeck, "Null is no card");
 }
 public void CreateDeck()
 {
     ICardDeck deck = new GenericDeck();
     Assert.AreEqual(0, deck.CardsInDeck, "New Deck should be empty.");
 }