Ejemplo n.º 1
0
        public void Can_Not_Find_Target_If_Out_Of_Range()
        {
            //arrange
            var range = 100;
            var tower = new SimpleTower() { Center = new PointF(0, 0), Range = range, Active = true };
            var enemy = new GroundEnemy(1.3F, 100, 100, null) { Center = new PointF(0, range + 1) };

            //act
            var target = tower.FindTarget(new List<BaseEnemy>() { enemy });

            //assert
            Assert.IsNull(target, "Tower found a target that is out of its range.");
        }
Ejemplo n.º 2
0
        public void Can_Find_Target_In_Range()
        {
            //arrange
            var range = 100;
            var tower = new SimpleTower() { Center = new PointF(0, 0), Range = range, Active = true };
            var enemy = new GroundEnemy(1.3F, 100, 100, null) { Center = new PointF(0, range) };

            //act
            var target = tower.FindTarget(new List<BaseEnemy>() { enemy });

            //assert
            Assert.IsNotNull(target, "Tower failed to find target that is within range.");
        }