public void VerifyRoverWrapsFromLeftOfGridToRight() { marsRover = new MarsRover(grid, 0, 0, DirectionConstants.West); marsRover.RunRoverWithCommands("f"); Assert.AreEqual(4, marsRover.XCoordinate); Assert.AreEqual(0, marsRover.YCoordinate); var stringGrid = marsRover.PrintMap(); System.Diagnostics.Debug.WriteLine(stringGrid); }
public void VerifyRoverWrapsFromTopOfGridToTheBottom() { marsRover = new MarsRover(grid, 2, 4, DirectionConstants.North); marsRover.RunRoverWithCommands("f"); Assert.AreEqual(2, marsRover.XCoordinate); Assert.AreEqual(0, marsRover.YCoordinate); var stringGrid = marsRover.PrintMap(); System.Diagnostics.Debug.WriteLine(stringGrid); }
public void RoverStopsAtObstacleInMultiStepPath() { grid.PlaceObstacleAt(4, 4); marsRover = new MarsRover(grid, 0, 0, DirectionConstants.East); marsRover.RunRoverWithCommands("fflffrflffrf"); Assert.IsTrue(marsRover.AtObstacle); var stringGrid = marsRover.PrintMap(); System.Diagnostics.Debug.WriteLine(stringGrid); }
public void GridToStringWorks() { grid.PlaceObstacleAt(4, 4); grid.PlaceObstacleAt(0, 0); marsRover = new MarsRover(grid, 0, 4, DirectionConstants.East); marsRover.RunRoverWithCommands("f"); var stringGrid = marsRover.PrintMap(); System.Diagnostics.Debug.WriteLine(stringGrid); Assert.AreEqual(".R__X\n_____\n_____\n_____\nX____\n", stringGrid); }
public void RoverStopsAtObstacleInPath(Char initialDirection) { grid.PlaceObstacleAt(1, 0); grid.PlaceObstacleAt(2, 1); grid.PlaceObstacleAt(0, 1); grid.PlaceObstacleAt(1, 2); marsRover = new MarsRover(grid, 1, 1, initialDirection); marsRover.RunRoverWithCommands("f"); Assert.IsTrue(marsRover.AtObstacle); var stringGrid = marsRover.PrintMap(); System.Diagnostics.Debug.WriteLine(stringGrid); }