public void ShouldCountUniqueCleaningSpots() { var startPosition = new Position(0, 0); var robot = new Simulator.Robot.Robot(new CleanedSpots(), startPosition); robot.Move(MoveCommand.Parse("N 10")); robot.Move(MoveCommand.Parse("S 10")); Assert.AreEqual(11, robot.CalculateCleanedSpots()); }
public void ShouldMoveRobotInMultipleDirections() { var startPosition = new Position(0, 0); var robot = new Simulator.Robot.Robot(null, startPosition); robot.Move(MoveCommand.Parse("N 1")); robot.Move(MoveCommand.Parse("E 3")); robot.Move(MoveCommand.Parse("S 4")); var position = robot.Move(MoveCommand.Parse("W 1")); Assert.AreEqual(-3, position.Y); Assert.AreEqual(2, position.X); }
public void MoveRobotEastNStep(int steps) { var startPosition = new Position(0, 0); var robot = new Simulator.Robot.Robot(null, startPosition); var position = robot.Move(MoveCommand.Parse($"E {steps}")); Assert.AreEqual(steps, position.X); }
public void ShouldHaveCleanedSpotsInOneDirection(string movement) { var startPosition = new Position(0, 0); var robot = new Simulator.Robot.Robot(new CleanedSpots(), startPosition); robot.Move(MoveCommand.Parse(movement)); Assert.AreEqual(6, robot.CalculateCleanedSpots()); }