public void TestMove_3() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(4, 0, Facing.EAST); robot.Move(); var newState = robot.ToString(); Assert.AreEqual("X: 4, Y: 0, Facing: EAST", newState, "East move failed - outside table right edge"); }
public void TestMove_4() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(0, 1, Facing.SOUTH); robot.Move(); var newState = robot.ToString(); Assert.AreEqual("X: 0, Y: 0, Facing: SOUTH", newState, "South move successful"); }
public void TestMove_2() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(0, 0, Facing.EAST); robot.Move(); var newState = robot.ToString(); Assert.AreEqual("X: 1, Y: 0, Facing: EAST", newState, "East move successful"); }
public void TestMove_1() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); var originalState = robot.ToString(); robot.Move(); var newState = robot.ToString(); Assert.AreEqual(originalState, newState, "Move action failed - No move before robot gets placed onto the table"); }
public void TestMove_9() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(0, 4, Facing.NORTH); robot.Move(); var newState = robot.ToString(); Assert.AreEqual("X: 0, Y: 4, Facing: NORTH", newState, "North move failed - outside table top edge"); }
public void TestMove_5() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(0, 0, Facing.SOUTH); robot.Move(); var newState = robot.ToString(); Assert.AreEqual("X: 0, Y: 0, Facing: SOUTH", newState, "South move failed - outside table bottom edge"); }
public void TestMove_3() { var mock = new Mock <IActionValidator>(); mock.Setup(m => m.Validate(It.IsAny <int>(), It.IsAny <int>())).Returns(true); IActionable robot = new TableRobot(mock.Object); robot.Place(1, 1, Facing.SOUTH); robot.Move(); var newState = robot.ToString(); Assert.AreEqual("X: 1, Y: 0, Facing: SOUTH", newState, "Move action (south) is successfull when validation is passed"); }