Exemplo n.º 1
0
        public void Test_EntityCanMove(Direction direction)
        {
            var level  = LevelCreator.OfSize(null, new Size(10, 10));
            var entity = new TestEntity(5, 5);

            level.PlaceObject(entity);
            Assert.IsTrue(level.InBounds(5, 5) && level[5, 5].GameObjects.Contains(entity));
            entity.Move(direction);
            var position = new Point(5, 5) + direction.GetOffsetFromDirection();

            Assert.IsTrue(CheckForEntity(position, entity, level));
        }