public void Robot_PlacedAndMoved_ReportsCorrectPosition() { var robot = new Robot(); robot.Place(1, 1, Facing.North); robot.Move(); Assert.AreEqual("1,2,NORTH", robot.Report()); }
public void Robot_InitialisedButNotPlaced_CannotBeMoved() { var robot = new Robot(); var result = robot.Move(); Assert.IsFalse(result); Assert.AreEqual("Robot cannot move until it has been placed on the table.", robot.LastError); }
public void Robot_PlacedAndMovedOffTable_CannotBeMoved() { var robot = new Robot(); robot.Place(5, 5, Facing.North); var result = robot.Move(); Assert.IsFalse(result); Assert.AreEqual("Robot cannot be moved there.", robot.LastError); Assert.AreEqual("5,5,NORTH", robot.Report()); }
public void Robot_PlacedMovedAndTurned_ReportsCorrectPosition() { var robot = new Robot(); robot.Place(1, 2, Facing.East); robot.Move(); robot.Move(); robot.Left(); robot.Move(); Assert.AreEqual("3,3,NORTH", robot.Report()); }