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); }
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(); }
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(); }