示例#1
0
            public void move_rover_for_12N(CoordinatesPoint coordinatesPoint,
                                           CompassPoints direction,
                                           IEnumerable <StringMovement> commands, int cX, int cY, CompassPoints cDirection)
            {
                var roverMove = new Rover(coordinatesPoint, cDirection);

                _plate.SetSize(5, 5);
                _plate.AddRover(roverMove);
                roverMove.Move(commands, _plate);

                var lastRover = _plate.GetLastRover();

                Assert.IsNotNull(lastRover);

                var currentPosition  = lastRover.GetCoordinatesPoint();
                var currentDirection = lastRover.GetCompassPoints();

                Assert.IsNotNull(currentPosition);
                Assert.IsNotNull(currentDirection);
                Assert.AreEqual(cX, currentPosition.X);
                Assert.AreEqual(cY, currentPosition.Y);
                Assert.AreEqual(cDirection, currentDirection);
            }
        public void SetRoverCurrentPosition(CoordinatesPoint point, CompassPoints cp)
        {
            var rover = new Rover(point, cp);

            _plate.AddRover(rover);
        }