Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }