예제 #1
0
        public void RemoveFromWrongCell()
        {
            var field = CreateField();
            var cell  = field.GetCell(1, 1);
            var Light = new TankLight();
            var Spatg = new TankSpatg();

            Light.GetFieldLocation().ToCell(cell);
            cell.RemoveCard(Spatg);
        }
예제 #2
0
        public void MoveToBusyCell()
        {
            var field = CreateField();
            var cell  = field.GetCell(1, 1);
            var Light = new TankLight();
            var Spatg = new TankSpatg();

            Light.GetFieldLocation().ToCell(cell);
            Spatg.GetFieldLocation().ToCell(cell);
        }
예제 #3
0
        public void CardFieldLocation()
        {
            var field = BattlefieldTest.CreateField();
            var card  = new TankLight();

            Assert.IsTrue(card.GetLocation().IsNowhere());
            Assert.IsFalse(card.GetLocation().IsForefront());
            Assert.IsFalse(card.GetLocation().IsBattlefield());
            Assert.AreEqual(null, card.GetFieldLocation().GetCell());

            card.GetFieldLocation().ToCell(field.GetCell(2, 1));
            Assert.AreEqual(field.GetCell(2, 1), card.GetFieldLocation().GetCell());
            Assert.IsFalse(card.GetLocation().IsNowhere());
            Assert.IsTrue(card.GetLocation().IsForefront());
            Assert.IsTrue(card.GetLocation().IsBattlefield());

            card.GetFieldLocation().ToCell(field.GetCell(3, 2));
            Assert.AreEqual(field.GetCell(3, 2), card.GetFieldLocation().GetCell());
            Assert.AreEqual(card, field.GetCell(3, 2).GetCard());
        }
예제 #4
0
        public void GettingAllCards()
        {
            var field = CreateField();
            var Light = new TankLight();
            var Spatg = new TankSpatg();
            var Heavy = new TankHeavy();

            Light.GetFieldLocation().ToCell(field.GetCell(1, 1));
            Spatg.GetFieldLocation().ToCell(field.GetCell(2, 1));

            var allCards = field.GetAllCards();

            Assert.AreEqual(2, allCards.Count);
            Assert.IsTrue(allCards.Contains(Light));
            Assert.IsTrue(allCards.Contains(Spatg));
        }