public void TestCanAction_5() { var mock = new Mock <IActionValidator>(); IActionable robot = new TableRobot(mock.Object); Assert.AreEqual(false, robot.CanAction(ActionType.REPORT), "Report action cannot be taken before the robot gets placed onto the table."); }
public void TestCanAction_1() { var mock = new Mock <IActionValidator>(); IActionable robot = new TableRobot(mock.Object); Assert.AreEqual(true, robot.CanAction(ActionType.PLACE), "Place action can always be taken."); }
public void TestToString() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); var result = robot.ToString(); Assert.AreEqual("X: -1, Y: -1, Facing: NORTH", result, "Test Robot.ToString()"); }
public void TestReport_1() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); var report = robot.Report(); Assert.AreEqual(string.Empty, report, "Report action failed - No report before robot gets placed onto the table"); }
public void TestCanAction_9() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(0, 0, Facing.NORTH); Assert.AreEqual(true, robot.CanAction(ActionType.REPORT), "Report action can be taken after the robot gets placed onto the table."); }
public void TestReport_2() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(0, 0, Facing.NORTH); var report = robot.Report(); Assert.AreEqual("X: 0, Y: 0, Facing: NORTH", report, "Report action successful"); }
public void TestPlace_2() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(0, 0, Facing.EAST); var newState = robot.ToString(); Assert.AreEqual("X: 0, Y: 0, Facing: EAST", newState, "Place action successful"); }
public void TestToString() { var mock = new Mock <IActionValidator>(); IActionable robot = new TableRobot(mock.Object); var result = robot.ToString(); Assert.AreEqual("X: -1, Y: -1, Facing: NORTH", result, "Test Robot.ToString()"); }
public void TestCanAction_9() { 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(0, 0, Facing.NORTH); Assert.AreEqual(true, robot.CanAction(ActionType.REPORT), "Report action can be taken after the robot gets placed onto the table."); }
public void TestReport_1() { var mock = new Mock <IActionValidator>(); mock.Setup(m => m.Validate(It.IsAny <int>(), It.IsAny <int>())).Returns(false); IActionable robot = new TableRobot(mock.Object); var report = robot.Report(); Assert.AreEqual(string.Empty, report, "Report action failed when validation is not passed"); }
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_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_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_6() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(1, 0, Facing.WEST); robot.Move(); var newState = robot.ToString(); Assert.AreEqual("X: 0, Y: 0, Facing: WEST", newState, "West move successful"); }
public void TestRight_5() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(0, 0, Facing.NORTH); robot.Right(); var newState = robot.ToString(); Assert.AreEqual("X: 0, Y: 0, Facing: EAST", newState, "Right action sucessful - from north to east"); }
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 TestRight_4() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); robot.Place(0, 0, Facing.WEST); robot.Right(); var newState = robot.ToString(); Assert.AreEqual("X: 0, Y: 0, Facing: NORTH", newState, "Right action sucessful - from west to north"); }
public void TestPlace_1() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); var originalState = robot.ToString(); robot.Place(5, 5, Facing.EAST); var newState = robot.ToString(); Assert.AreEqual(originalState, newState, "Place action failed - outside 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 TestReport_2() { 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.WEST); var report = robot.Report(); Assert.AreEqual("X: 1, Y: 1, Facing: WEST", report, "Report action successful when validation is passed"); }
public void TestMove_1() { var mock = new Mock <IActionValidator>(); mock.Setup(m => m.Validate(It.IsAny <int>(), It.IsAny <int>())).Returns(false); IActionable robot = new TableRobot(mock.Object); var originalState = robot.ToString(); robot.Place(1, 1, Facing.EAST); var newState = robot.ToString(); Assert.AreEqual(originalState, newState, "Move action is failed when validation is not passed"); }
public void TestLeft_5() { 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(0, 0, Facing.EAST); robot.Left(); var newState = robot.ToString(); Assert.AreEqual("X: 0, Y: 0, Facing: NORTH", newState, "Left action sucessful - from east to north"); }
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"); }
public void TestPlace_1() { var mock = new Mock <IActionValidator>(); mock.Setup(m => m.Validate(It.IsAny <int>(), It.IsAny <int>())).Returns(true); IActionable robot = new TableRobot(mock.Object); var originalState = robot.ToString(); robot.Place(5, 5, Facing.EAST); var newState = robot.ToString(); Assert.AreNotEqual(originalState, newState, "Place action is successfull when validation is passed"); Assert.AreEqual("X: 5, Y: 5, Facing: EAST", newState, "Place action is successfull when validation is passed"); }
public void TestRight_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(0, 0, Facing.SOUTH); robot.Right(); var newState = robot.ToString(); Assert.AreEqual("X: 0, Y: 0, Facing: WEST", newState, "Right action sucessful - from south to west"); }
public void TestCanAction_5() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); Assert.AreEqual(false, robot.CanAction(ActionType.REPORT), "Report action cannot be taken before the robot gets placed onto the table."); }
public void TestCanAction_1() { IActionable robot = new TableRobot(new FiveByFiveTableActionValidator()); Assert.AreEqual(true, robot.CanAction(ActionType.PLACE), "Place action can always be taken."); }