Exemplo n.º 1
0
        public void getRobotR2()
        {
            mockRobotInstructions = new MockRobotInstructions(repository);
            var resultRobot = mockRobotInstructions.GetRobot("r2");

            Assert.NotNull(resultRobot);
        }
Exemplo n.º 2
0
        public void PrintTest()
        {
            mockRobotInstructions = new MockRobotInstructions(repository);
            // Shoul be Empty.
            var moveInstructions = mockRobotInstructions.getRobotInstructions("r1");
            var charArr          = moveInstructions.ToCharArray();
            var r1 = mockRobotInstructions.GetRobot("r1");

            robotController = new RobotController(repository);
            ;
        }
Exemplo n.º 3
0
        public void RobotR4CheckFaults()
        {
            mockRobotInstructions = new MockRobotInstructions(repository);
            // Shoul be Empty.
            var moveInstructions = mockRobotInstructions.getRobotInstructions("r4");
            var charArr          = moveInstructions.ToCharArray();
            var r4 = mockRobotInstructions.GetRobot("r4");

            robotController = new RobotController(repository);
            var final  = robotController.MoveRobot(r4, charArr);
            var result = final.Faults;

            Assert.NotEqual(3, result);
        }
        public void robotInstruction(string key)
        {
            mockRobotInstructions = new MockRobotInstructions(_repository);
            //Get Instructions
            char[] charInstructList = mockRobotInstructions
                                      .getRobotInstructions(key)
                                      .ToCharArray();
            //

            // Get Robot plus initial values.
            Console.WriteLine(charInstructList);
            var robotInitial = mockRobotInstructions.GetRobot(key);

            // Move Robot function.
            MoveRobot(robotInitial, charInstructList);
        }
Exemplo n.º 5
0
        public void moveRobotR4FinalPosition()
        {
            mockRobotInstructions = new MockRobotInstructions(repository);
            // Shoul be Empty.
            var robotInstructions = mockRobotInstructions.getRobotInstructions("r4");
            var CharArr           = robotInstructions.ToCharArray();
            var r4 = mockRobotInstructions.GetRobot("r4");

            robotController = new RobotController(repository);

            var result = robotController.MoveRobot(r4, CharArr);
            // FInal position expectation for r1
            var expected = new Robot(new Location(0, 0, 'S'));

            expected.Faults = 3;
            Assert.NotEqual(expected, result);
        }
Exemplo n.º 6
0
        public void moveRobotR1()
        {
            mockRobotInstructions = new MockRobotInstructions(repository);
            // Shoul be Empty.
            var MoveInstructions = mockRobotInstructions.getRobotInstructions("r1");

            var charrArr    = MoveInstructions.ToCharArray();
            var resultRobot = mockRobotInstructions.GetRobot("r1");

            robotController = new RobotController(repository);

            var r1 = robotController.MoveRobot(resultRobot, charrArr);

            var expected = new Robot(new Location(0, 3, 'N'));

            expected.Faults = 0;
            Assert.Equal(expected, r1);
        }