示例#1
0
        public void RunMarsRoverForInitialPosition12NAndCommandInstructionM()
        {
            roverCommands.Add(RoverCommand.Move);
            marsRover.Run(roverCommands);
            var mock = new MarsRoverPositionMock(1, 3, NavigationDirection.North);

            Assert.IsTrue(marsRover.GetCurrentPostionAndDirection().Equals(mock));
        }
示例#2
0
        public void ValidateMarsRoverStopsAtMaxCoOrinatesOfPlateu()
        {
            MarsPlateu marsPlateu = new MarsPlateu(3, 3);
            MarsRover  marsRover  = MarsRover.CreateRover(new MarsRoverPositionMock(2, 2, NavigationDirection.North), marsPlateu);

            roverCommands.Add(RoverCommand.Move);
            roverCommands.Add(RoverCommand.Move);
            roverCommands.Add(RoverCommand.Right);
            roverCommands.Add(RoverCommand.Move);
            roverCommands.Add(RoverCommand.Move);
            marsRover.Run(roverCommands);
            var mock = new MarsRoverPositionMock(3, 3, NavigationDirection.East);

            Assert.IsTrue(marsRover.GetCurrentPostionAndDirection().Equals(mock));
        }