Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
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.");
        }
Ejemplo n.º 3
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);
        }