예제 #1
0
        public void When_reports_Yposition_then_Yposition_matches_initialY(int actualY)
        {
            var map = new Map(10, 10);
            var rover = new Rover();

            rover.Land(map, 0, actualY, CompassPoint.North);

            Assert.That(rover.Y, Is.EqualTo(actualY));
        }
예제 #2
0
        private void SetupRover(string initialDirection)
        {
            const int maxX = 10;
            const int maxY = 10;
            var givenDirection = ParseCompassPoint(initialDirection);

            map = new Map(maxX, maxY);
            rover = new Rover();
            rover.Land(map, 0, 0, givenDirection);
        }
예제 #3
0
        public void When_reports_Direction_then_Direction_matches_initialDirection(string direction)
        {
            var map = new Map(10, 10);
            var rover = new Rover();

            CompassPoint givenDirection;
            Assert.That(CompassPoint.TryParse(direction, false, out givenDirection), Is.Not.False);

            rover.Land(map, 0, 0, givenDirection);

            Assert.That(rover.Direction, Is.EqualTo(givenDirection));
        }
예제 #4
0
        public void DeployRover(string deployCommand)
        {
            var parameters = deployCommand.Split(new [] {' '}, StringSplitOptions.RemoveEmptyEntries);
            var mapX = Int32.Parse(parameters[0]);
            var mapY = Int32.Parse(parameters[1]);

            var map = new Map(mapX, mapY);

            var roverX = Int32.Parse(parameters[2]);
            var roverY = Int32.Parse(parameters[3]);

            _rover.Land(map, roverX, roverY, ConvertOrientation(parameters[4]));
        }
예제 #5
0
 public void SetUp()
 {
     _map = new Map(10,10);
 }