Ejemplo n.º 1
0
        public void All_Robotic_rover_move_inmars_plateau()
        {
            IMatrix   plateau            = new MarsPlateau(5, 5);
            IPosition positionfirst      = new RoboticPosition(1, 2);
            IPosition positionsecond     = new RoboticPosition(3, 3);
            var       roboticRoverFirst  = new RoboticRover(positionfirst, Direction.N, plateau);
            var       roboticRoverSecond = new RoboticRover(positionsecond, Direction.E, plateau);

            roboticRoverFirst.Move("LMLMLMLMM");

            var control = new MovementControl <IRover, IMatrix>(roboticRoverFirst, plateau).RoverInMatrix();

            Assert.IsTrue(control);
            Assert.IsTrue(roboticRoverFirst.Position.X == 1, "First Position X is not true!");
            Assert.IsTrue(roboticRoverFirst.Position.Y == 3, "First Position Y is not true!");
            Assert.IsTrue(roboticRoverFirst.Direction == Direction.N, "First Direction is wrong!");

            roboticRoverSecond.Move("MMRMMRMRRM");
            control = new MovementControl <IRover, IMatrix>(roboticRoverSecond, plateau).RoverInMatrix();

            Assert.IsTrue(control);
            Assert.IsTrue(roboticRoverSecond.Position.X == 5, "Second Position X is not true!");
            Assert.IsTrue(roboticRoverSecond.Position.Y == 1, "Second Position Y is not true!");
            Assert.IsTrue(roboticRoverSecond.Direction == Direction.E, "Second Direction is wrong!");
        }
Ejemplo n.º 2
0
        public void MoveTest()
        {
            Plateau plateau = new Plateau(1, 1);

            plateau.XAxis = 1;
            robotic.Move(plateau);
        }
Ejemplo n.º 3
0
        public void Second_Robotic_rover_move_inmars_plateau()
        {
            IMatrix   plateau  = new MarsPlateau(5, 5);
            IPosition position = new RoboticPosition(3, 3);

            var roboticRover = new RoboticRover(position, Direction.E, plateau);

            roboticRover.Move("MMRMMRMRRM");
            var control = new MovementControl <IRover, IMatrix>(roboticRover, plateau).RoverInMatrix();

            Assert.IsTrue(control);
            Assert.IsTrue(roboticRover.Position.X == 5, "Position X is not true");
            Assert.IsTrue(roboticRover.Position.Y == 1, "Position Y is not true");
            Assert.IsTrue(roboticRover.Direction == Direction.E, "Direction is not true");
        }