public void TransmitCommandSequenceTest()
        {
            //arrange
            var mocks = new Mocks();
            var robots = new List<Robot> { mocks.GetRobot() };
            var commandStation = new CommandStation(robots);

            //act
            commandStation.TransmitCommandSequence(0, mocks.GetCommandSequence());

            //assert
            var robot = commandStation.Robots[0];
            Assert.AreEqual(3, robot.X);
            Assert.AreEqual(3, robot.Y);
            Assert.AreEqual(Orientation.north, robot.Orientation);
            Assert.AreEqual(true, robot.IsLost);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var input = Input.GetUserInput();
            List<Robot> robots;
            List<List<Command>> commandSequences;
            Input.GetRobotsAndCommandSequences(input, out robots, out commandSequences);

            var commandStation = new CommandStation(robots);
            for(int i=0; i<commandStation.Robots.Count(); i++)
                commandStation.TransmitCommandSequence(i, commandSequences[i]);

            var robotReport = Output.GetRobotReport(robots);
            Console.Write(robotReport);

            Console.Write("Press any key to exit...");
            Console.ReadKey();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            var                    input = Input.GetUserInput();
            List <Robot>           robots;
            List <List <Command> > commandSequences;

            Input.GetRobotsAndCommandSequences(input, out robots, out commandSequences);

            var commandStation = new CommandStation(robots);

            for (int i = 0; i < commandStation.Robots.Count(); i++)
            {
                commandStation.TransmitCommandSequence(i, commandSequences[i]);
            }

            var robotReport = Output.GetRobotReport(robots);

            Console.Write(robotReport);

            Console.Write("Press any key to exit...");
            Console.ReadKey();
        }