示例#1
0
 public void Cleanup()
 {
     _start           = Point.Empty;
     _destination     = Point.Empty;
     _positionChecker = null;
     _field           = null;
     _systemUnderTest = null;
 }
示例#2
0
        public void Setup()
        {
            _start       = new Point(1, 0);
            _destination = new Point(0, 1);

            _field                    = new Mock <IField>();
            _positionChecker          = new Mock <IPositionChecker>();
            IAnimal[,] defaultAnimals = new IAnimal[2, 3];

            _field.Setup(f => f.Width).Returns(3);
            _field.Setup(f => f.Heigth).Returns(2);
            _field.Setup(f => f.Animals).Returns(defaultAnimals);

            _systemUnderTest = new PointReplacer(_positionChecker.Object, _field.Object);
        }
示例#3
0
 public MovementHandler
 (
     IPositionHandler positionHandler,
     IPointReplacer pointReplacer,
     IAnimalFinder animalFinder,
     IHealthHandler healthHandler,
     IField field
 )
 {
     _field           = field;
     _positionHandler = positionHandler;
     _pointReplacer   = pointReplacer;
     _animalFinder    = animalFinder;
     _healthHandler   = healthHandler;
 }