示例#1
0
        public void ThrowOutOfPlateauExceptionWhenMoveToNewCoordinatesExceedsBorders()
        {
            DirectionClass direction = DirectionFactory.GetDirection('S');

            var result = Record.Exception(() => borderStrategy.MoveToNewCoordinates(coordinates, direction));

            Assert.NotNull(result);
            Assert.IsType <OutOfPlateauException>(result);
        }
        public void WaitAtTheBorderWhenMoveToNewCoordinatesExceedsBorders()
        {
            DirectionClass direction = DirectionFactory.GetDirection('S');

            var result = borderStrategy.MoveToNewCoordinates(coordinates, direction);

            int expectedCoordX = 0;
            int expectedCoordY = 0;

            Assert.NotNull(result);
            Assert.Equal(expectedCoordX, result.coordX);
            Assert.Equal(expectedCoordY, result.coordY);
        }
示例#3
0
 /// <summary>
 /// Moves the Rover to the new Coordinates according to facing direction and chosen border strategy
 /// </summary>
 public void Move()
 {
     currentCoordinates = chosenBorderStrategy.MoveToNewCoordinates(currentCoordinates, currentDirection);
 }