Esempio n. 1
0
 public void Robot_PlacedAndTurnedLeft_ReportsCorrectPosition()
 {
     var robot = new Robot();
     robot.Place(1, 1, Facing.North);
     robot.Left();
     Assert.AreEqual("1,1,WEST", robot.Report());
 }
Esempio n. 2
0
 public void Robot_InitialisedButNotPlaced_CannotBeTurned()
 {
     var robot = new Robot();
     var result = robot.Left();
     Assert.IsFalse(result);
     Assert.AreEqual("Robot cannot turn until it has been placed on the table.", robot.LastError);
 }
Esempio n. 3
0
 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());
 }