public void NotMoveWithoutPlaceCall() { TestGameController controller = new TestGameController(5, 5); controller.RunCommand(Commands.Right, CommandParams.Empty); controller.RunCommand(Commands.Move, CommandParams.Empty); controller.RunCommand(Commands.Move, CommandParams.Empty); Assert.AreEqual(0, controller.Robot.X); }
public void NotMoveWith1x1BoardButChangeDirectionTowardsSouth() { TestGameController controller = new TestGameController(1, 1); controller.RunCommand(Commands.Place, new PlaceCommandParams(0, 0, Direction.NORTH)); controller.RunCommand(Commands.Right, CommandParams.Empty); controller.RunCommand(Commands.Right, CommandParams.Empty); controller.RunCommand(Commands.Move, CommandParams.Empty); Assert.AreEqual(0, controller.Robot.X); Assert.AreEqual(0, controller.Robot.Y); Assert.AreEqual(Direction.SOUTH, controller.Robot.Direction); }
public void Move2StepsTowardsEast() { TestGameController controller = new TestGameController(5, 5); controller.RunCommand(Commands.Place, new PlaceCommandParams(0, 0, Direction.NORTH)); controller.RunCommand(Commands.Right, CommandParams.Empty); controller.RunCommand(Commands.Move, CommandParams.Empty); controller.RunCommand(Commands.Move, CommandParams.Empty); Assert.AreEqual(2, controller.Robot.X); Assert.AreEqual(0, controller.Robot.Y); Assert.AreEqual(Direction.EAST, controller.Robot.Direction); }