コード例 #1
0
ファイル: SessionTest.cs プロジェクト: FrankT1983/ZombieCards
        public void FromEmptyDeck()
        {
            ICardDeck deck = new GenericDeck();
            var session = deck.StartNewSession();

            Assert.AreEqual(0, session.CardsRemaining, " Should have no cards remaining.");
        }
コード例 #2
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");
        }
コード例 #3
0
ファイル: SessionTest.cs プロジェクト: FrankT1983/ZombieCards
        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.");
        }
コード例 #4
0
ファイル: SessionTest.cs プロジェクト: FrankT1983/ZombieCards
        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);
        }
コード例 #5
0
 public void InsertCardsNull()
 {
     ICardDeck deck = new GenericDeck();
     deck.InsertCard(null);
     Assert.AreEqual(0, deck.CardsInDeck, "Null is no card");
 }
コード例 #6
0
 public void CreateDeck()
 {
     ICardDeck deck = new GenericDeck();
     Assert.AreEqual(0, deck.CardsInDeck, "New Deck should be empty.");
 }