예제 #1
0
        private static void InitializeServices()
        {
            IKernel kernel = new StandardKernel(new NinjectComposer());

            _parseInputsService          = kernel.Get <ParseInputsService>();
            _processRobotMovementService = kernel.Get <RobotMovementService>();
        }
예제 #2
0
        public void Initialization()
        {
            _instructionFactory = new Mock <IInstructionFactory>();
            _parseInputsService = new ParseInputsService(_instructionFactory.Object);

            _instructionFactory.Setup(f => f.CreateInstruction('L')).Returns(new RotateLeftInstruction());
            _instructionFactory.Setup(f => f.CreateInstruction('R')).Returns(new RotateRightInstruction());
            _instructionFactory.Setup(f => f.CreateInstruction('F')).Returns(new GoForwardInstruction());
        }
예제 #3
0
        public MartianRobotsMainViewModel(IRobotMovementService processRobotMovement, IParseInputsService parseInputsService)
        {
            _processRobotMovement = processRobotMovement;
            _parseInputsService   = parseInputsService;

            InitializeCommands();

            PlainInput             = new RawInput();
            InputRobots            = new ObservableCollection <Robot>();
            RobotsProcessedOutputs = new ObservableCollection <RobotOutput>();

            RobotId         = 0;
            OrientationType = OrientationTypes.N;

            LogMessages = _parseInputsService.ParseMessages;
        }