예제 #1
0
        public void TestScoreAndDespawn()
        {
            lane = new Lane(FieldTest.CELLS_NUM);
            lane.AddUnit(unit1);

            for (int i = 0; i < FieldTest.CELLS_NUM; i++)
            {
                Assert.AreEqual(i, lane.GetUnits()[unit1]);
                lane.Update();
            }

            Assert.AreEqual(1, lane.GetScore(PlayerType.PLAYER1));
            Assert.IsFalse(lane.GetUnits().ContainsKey(unit1));
        }
예제 #2
0
        public void TestMovement()
        {
            lane.Update();
            lane.Update();

            Assert.AreEqual(2, lane.GetUnits()[unit1]);
            Assert.AreEqual(FieldTest.CELLS_NUM - 3, lane.GetUnits()[unit2]);

            lane.Update();

            Assert.AreEqual(3, lane.GetUnits()[unit1]);
            Assert.AreEqual(FieldTest.CELLS_NUM - 4, lane.GetUnits()[unit2]);
        }