Exemplo n.º 1
0
    public void TestScentProtection()
    {
        Planet           planet     = new Planet(5, 3);
        RobotsController controller = new RobotsController(planet);

        Robot robot = controller.InitializeRobot("3 2 N");

        controller.MoveRobot(robot, InputParser.parseMovementList("FRRFLLFFRRFLL"));

        Robot robot2 = controller.InitializeRobot("0 3 W");

        controller.MoveRobot(robot2, InputParser.parseMovementList("LLFFFLFLFL"));

        Assert.Equal("2 3 S", robot2.GetPosition());
    }
Exemplo n.º 2
0
    public void TestMoveRobot(string position, string movementsString, string expected)
    {
        List <IMovement> movements  = InputParser.parseMovementList(movementsString);
        Planet           planet     = new Planet(5, 3);
        RobotsController controller = new RobotsController(planet);
        Robot            robot      = controller.InitializeRobot(position);

        controller.MoveRobot(robot, movements);

        Assert.Equal(expected, robot.GetPosition());
    }