Esempio n. 1
0
        public void TestScenario4()
        {
            // Arrange
            initial.Location   = new Point(1, 3);
            initial.Direction  = CardinalDirection.North;
            expected.Location  = new Point(0, 0);
            expected.Direction = CardinalDirection.South;
            int expectedPenalties = 3;

            robot = new Robot(initial);
            mover = new RobotMover(robot, arena);

            string instructions = "MMLMMLMMMMM";

            // Act
            mover.RunInstructions(instructions.ToCharArray());

            // Assert
            Assert.AreEqual(expected, robot.AgentTelemetry, $"The expected ({expected.ToString()}) does not match the result ({robot.AgentTelemetry})");
            Assert.AreEqual(expectedPenalties, robot.Penalties, "Number of penalties does not match");
        }
Esempio n. 2
0
 public void SetUp()
 {
     _robotMover = new RobotMover();
     _currentRobotPosition = new RobotPosition {X = 0, Y = 0};
 }
 // Start is called before the first frame update
 void Start()
 {
     _robot         = transform.GetComponent <RobotMover>();
     _sensorForward = _robot._sensorForward;
 }