Ejemplo n.º 1
0
        public void PlaceRobotCorrectlyTests(string commandInput, int expectedX, int expectedY, Direction expectedDirection)
        {
            IRobotCommander robotCommander = new RobotCommander(commandInput);

            robotCommander.ExecuteCommands();
            List <IRobot> robots   = robotCommander.GetRobots();
            Position      position = robots[0].GetPosition();

            Assert.AreEqual(expectedX, position.X);
            Assert.AreEqual(expectedY, position.Y);
            Assert.AreEqual(expectedDirection, position.Direction);
        }
Ejemplo n.º 2
0
        public void RobotsMoveToCorrectLocationTests(string commandInput, int initialX, int initialY, Direction initialDirection, int expectedX, int expectedY, Direction expectedDirection)
        {
            IRobotCommander robotCommander = new RobotCommander(commandInput);

            robotCommander.AddBattleRobot(new BattleRobot(initialX, initialY, initialDirection));

            robotCommander.ExecuteCommands();
            List <IRobot> robots   = robotCommander.GetRobots();
            Position      position = robots[0].GetPosition();

            Assert.AreEqual(expectedX, position.X);
            Assert.AreEqual(expectedY, position.Y);
            Assert.AreEqual(expectedDirection, position.Direction);
        }