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 TestInitializeRobot()
    {
        Planet           planet     = new Planet(5, 3);
        RobotsController controller = new RobotsController(planet);
        Robot            robot      = controller.InitializeRobot("1 2 E");

        Assert.Equal("1 2 E", robot.GetPosition());
    }
Exemplo n.º 3
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());
    }