示例#1
0
        public void MaxNumberRemovableTest()
        {
            Assert.AreEqual(0, space.MaxNumberRemovable());
            Card        c    = RandomCard.GetRandomCard();
            List <Card> temp = new List <Card>();

            temp.Add(c);
            space.Place(temp);
            Assert.AreEqual(1, space.MaxNumberRemovable());
        }
示例#2
0
        public void FreeSpaceIsFreeTest()
        {
            Assert.IsTrue(space.IsFree());
            Card        c    = RandomCard.GetRandomCard();
            List <Card> temp = new List <Card>();

            temp.Add(c);
            space.Place(temp);
            Assert.IsFalse(space.IsFree());
        }
示例#3
0
        public void GetCardTest()
        {
            TestCardStack cards = new TestCardStack();
            Card          c     = RandomCard.GetRandomCard();

            cards.CardList.Add(c);
            Card d = cards.GetCard(0);

            Assert.AreEqual(c, d);
        }
示例#4
0
        public void IsPlaceableTest()
        {
            Card        c    = RandomCard.GetRandomCard();
            List <Card> temp = new List <Card>();

            temp.Add(c);
            temp.Add(c);
            Assert.IsFalse(space.IsPlaceable(temp));
            temp.Remove(c);
            Assert.IsTrue(space.IsPlaceable(temp));
            space.Place(temp);
            Assert.IsFalse(space.IsPlaceable(temp));
        }
示例#5
0
        public void Initialize()
        {
            sourceToModify       = new TestCardStack();
            sourceToCompare      = new TestCardStack();
            destinationToModify  = new TestCardStack();
            destinationToCompare = new TestCardStack();

            for (int i = 0; i < stackSize; i++)
            {
                Card rand1 = RandomCard.GetRandomCard();
                Card rand2 = RandomCard.GetRandomCard();

                sourceToCompare.CardList.Add(rand1);
                sourceToModify.CardList.Add(rand1);
                destinationToCompare.CardList.Add(rand2);
                destinationToModify.CardList.Add(rand2);
            }
        }