Exemplo n.º 1
0
        private MarsRover GetDefaultRover()
        {
            MarsPlateu marsPlateu = new MarsPlateu(5, 5);
            MarsRover  marsRover  = MarsRover.CreateRover(new MarsRoverPositionMock(1, 2, NavigationDirection.North), marsPlateu);

            return(marsRover);
        }
Exemplo n.º 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));
        }