Esempio n. 1
0
        public void Test_ParseValidCommand()
        {

            Robot robot = new Robot();
            RemoteController controller = new RemoteController(robot);
            controller.RunCommand("Place 1,2,EAST");
            Assert.AreEqual(controller.ParseCommand("MOVE"), Command.Move);

        }      
Esempio n. 2
0
 public void Test_RunCommand() {
     Robot robot = new Robot();
     RemoteController controller = new RemoteController(robot);
     controller.RunCommand("Place 1,2,EAST");
     controller.RunCommand("Move");
     controller.RunCommand("Move");
     controller.RunCommand("LEFT");
     controller.RunCommand("Move");
     
     Assert.AreEqual(robot.Report(), "Output: 3,3,NORTH");
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            
            RemoteController controller = new RemoteController(new Robot());
            controller.RunCommand("Place 0,0,NORTH");
            controller.RunCommand("MOVE");
            controller.RunCommand("Report");

            controller.RunCommand("Place 0,0,NORTH");
            controller.RunCommand("LEFT");
            controller.RunCommand("Report");

            controller.RunCommand("Place 1,2,EAST");
            controller.RunCommand("Move");
            controller.RunCommand("Move");
            controller.RunCommand("LEFT");
            controller.RunCommand("Move");
            controller.RunCommand("Report");

            Console.Read();

        }