Ejemplo n.º 1
0
        public void TestDevCardsContainsReturnsFalseWhenCardIsNotInHand()
        {
            var target = new Hand();

            List<DevelopmentCard> knight = new List<DevelopmentCard>();
            knight.Add(new Knight());
            target.addDevCard(knight);
            Assert.IsFalse(target.devCardsContains("monopoly"));

            List<DevelopmentCard> monopoly = new List<DevelopmentCard>();
            monopoly.Add(new MonopolyCard());
            target.addDevCard(monopoly);
            Assert.IsFalse(target.devCardsContains("victoryPoint"));

            List<DevelopmentCard> victoryPoint = new List<DevelopmentCard>();
            victoryPoint.Add(new VictoryPointCard());
            target.addDevCard(victoryPoint);
            Assert.IsFalse(target.devCardsContains("roadBuilder"));

            List<DevelopmentCard> roadBuilder = new List<DevelopmentCard>();
            roadBuilder.Add(new RoadBuilderCard());
            target.addDevCard(roadBuilder);
            Assert.IsFalse(target.devCardsContains("yearOfPlenty"));

            List<DevelopmentCard> yearOfPlenty = new List<DevelopmentCard>();
            yearOfPlenty.Add(new YearOfPlentyCard());
            target.addDevCard(yearOfPlenty);

            target.removeDevCard("knight");
            Assert.IsFalse(target.devCardsContains("knight"));
        }
Ejemplo n.º 2
0
        public void TestDevCardsContains()
        {
            var target = new Hand();

            List<DevelopmentCard> cards = new List<DevelopmentCard>();
            cards.Add(new Knight());
            cards.Add(new MonopolyCard());
            cards.Add(new VictoryPointCard());
            cards.Add(new RoadBuilderCard());
            cards.Add(new YearOfPlentyCard());

            target.addDevCard(cards);

            Assert.AreEqual(5, target.getDevCardCount());

            Assert.IsTrue(target.devCardsContains("knight"));
            Assert.IsTrue(target.devCardsContains("monopoly"));
            Assert.IsTrue(target.devCardsContains("victoryPoint"));
            Assert.IsTrue(target.devCardsContains("roadBuilder"));
            Assert.IsTrue(target.devCardsContains("yearOfPlenty"));
        }
Ejemplo n.º 3
0
 public void TestDevCardsContainsReturnsFalseWhenThereAreNoDevCardsInHand()
 {
     var target = new Hand();
     Assert.IsFalse(target.devCardsContains("buffalo"));
 }