Exemplo n.º 1
0
        public void Setup()
        {
            context = new Context(new SurfaceBuilder(), new RobotBuilder());
            logger  = new Mock <ILogger>();
            createSurfaceInstructionReader = new CreateSurfaceInstructionReader(context, logger.Object);
            createSurfaceInstructionReader.Process("5 3");
            createRobotInstructionReader = new CreateRobotInstructionReader(context, logger.Object);
            var supportedInstructions = new List <IInstruction> {
                new MoveForwardInstruction(), new TurnInstruction()
            };

            moveRobotInstructionReader = new MoveRobotInstructionReader(context, supportedInstructions, logger.Object);
        }
        public void Setup()
        {
            robot = new Mock <IRobot>();
            var context = new Mock <IContext>();
            var logger  = new Mock <ILogger>();
            var supportedInstructions = new List <IInstruction> {
                new MoveForwardInstruction(), new TurnInstruction()
            };

            context.SetupGet(c => c.Robot).Returns(robot.Object);

            moveInstructionReader = new MoveRobotInstructionReader(context.Object, supportedInstructions, logger.Object);
        }