Пример #1
0
        public void TestOutput()
        {
            // Arrange.
            var instructionStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PSCL.RoverTest.RoverInstructions.txt");
            var roversController  = new PSCL.Rover.RoversController(instructionStream);

            // Act.
            var result = roversController.Execute();

            // Assert.
            Assert.AreEqual("1 3 N\r\n5 1 E\r\n", result);
        }
Пример #2
0
        static int Main(string [] args)
        {
            if ((args == null) || (args.Length != 1))
            {
                Console.WriteLine("RoverHost requires a single argument, the name of a plain text file containing a plateau definition and rover instructions.");

                return(1);
            }
            if (!File.Exists(args [0]))
            {
                Console.WriteLine("RoverHost requires a single argument, the name of a plain text file containing a plateau definition and rover instructions.");

                return(1);
            }

            var roverController = new PSCL.Rover.RoversController(args [0]);
            var output          = roverController.Execute();

            Console.Write(output);

            return(0);
        }