Пример #1
0
 public void SetUp()
 {
     _rover = new Rover {
         Orientation = Orientation.South
     };
     _roverMover = new RoverMover(_rover);
 }
Пример #2
0
        public void Move_Should_Throw_If_Outbounded(double x, double y, Facing facing)
        {
            var currentLocation = new Location(new Position(x, y), facing);
            var plateau         = new Plateau(5, 5);

            var mover = new RoverMover();

            Assert.Throws <MoveException>(() => mover.Move(currentLocation, plateau));
        }
Пример #3
0
        public void Move_Should_Move_Position(double x, double y, Facing facing, double targetX, double targetY)
        {
            var currentLocation = new Location(new Position(x, y), facing);
            var plateau         = new Plateau(5, 5);

            var mover = new RoverMover();

            var targetPosition = mover.Move(currentLocation, plateau);

            Assert.Equal(targetX, targetPosition.X);
            Assert.Equal(targetY, targetPosition.Y);
        }