示例#1
0
 public Factory(CreateDebugPropertyDelegate createPropertyDelegate,
                VarInfoBuilder varInfoBuilder, VsExpressionCreator vsExpressionCreator,
                ErrorDebugProperty.Factory errorDebugPropertyFactory,
                IDebugEngineCommands debugEngineCommands,
                IExtensionOptions extensionOptions,
                ExpressionEvaluationRecorder expressionEvaluationRecorder,
                ITimeSource timeSource)
 {
     _createPropertyDelegate       = createPropertyDelegate;
     _varInfoBuilder               = varInfoBuilder;
     _vsExpressionCreator          = vsExpressionCreator;
     _errorDebugPropertyFactory    = errorDebugPropertyFactory;
     _debugEngineCommands          = debugEngineCommands;
     _extensionOptions             = extensionOptions;
     _expressionEvaluationRecorder = expressionEvaluationRecorder;
     _timeSource = timeSource;
 }
示例#2
0
        public void SetUp()
        {
            _mockDebuggerStackFrame = Substitute.For <RemoteFrame>();
            var childAdapterFactory = new RemoteValueChildAdapter.Factory();
            var varInfoFactory      = new LLDBVariableInformationFactory(childAdapterFactory);

            _vsExpressionCreator = new VsExpressionCreator();

            _metrics = Substitute.For <IMetrics>();
            var eventScheduler        = new EventSchedulerFake();
            var eventSchedulerFactory = Substitute.For <IEventSchedulerFactory>();

            eventSchedulerFactory.Create(Arg.Do <System.Action>(a => eventScheduler.Callback = a))
            .Returns(eventScheduler);
            var       timer = new TimerFake();
            const int minimumBatchSeparationMilliseconds = 1;
            var       batchEventAggregator =
                new BatchEventAggregator <ExpressionEvaluationBatch, ExpressionEvaluationBatchParams,
                                          ExpressionEvaluationBatchSummary>(minimumBatchSeparationMilliseconds,
                                                                            eventSchedulerFactory, timer);

            _expressionEvaluationRecorder =
                new ExpressionEvaluationRecorder(batchEventAggregator, _metrics);
            _timeSource = new MonotonicTimeSource();

            _taskExecutor = Substitute.ForPartsOf <FakeTaskExecutor>();

            var enumFactory = new VariableInformationEnum.Factory(_taskExecutor);

            var childrenProviderFactory = new ChildrenProvider.Factory();
            var debugPropertyFactory    = new DebugProperty.Factory(
                enumFactory, childrenProviderFactory, null, _vsExpressionCreator, _taskExecutor);

            _createPropertyDelegate = debugPropertyFactory.Create;

            childrenProviderFactory.Initialize(_createPropertyDelegate);

            _varInfoBuilder = new VarInfoBuilder(varInfoFactory);
            varInfoFactory.SetVarInfoBuilder(_varInfoBuilder);

            _engineCommandsMock = Substitute.For <IDebugEngineCommands>();

            _mockDebugEngineHandler = Substitute.For <IDebugEngineHandler>();
            _mockProgram            = Substitute.For <IGgpDebugProgram>();
            _mockThread             = Substitute.For <IDebugThread2>();
        }
示例#3
0
 AsyncExpressionEvaluator(RemoteFrame frame, string text,
                          VsExpressionCreator vsExpressionCreator,
                          VarInfoBuilder varInfoBuilder,
                          CreateDebugPropertyDelegate createPropertyDelegate,
                          ErrorDebugProperty.Factory errorDebugPropertyFactory,
                          IDebugEngineCommands debugEngineCommands,
                          ExpressionEvaluationStrategy expressionEvaluationStrategy,
                          ExpressionEvaluationRecorder expressionEvaluationRecorder,
                          ITimeSource timeSource)
 {
     _frame = frame;
     _text  = text;
     _vsExpressionCreator          = vsExpressionCreator;
     _varInfoBuilder               = varInfoBuilder;
     _createPropertyDelegate       = createPropertyDelegate;
     _errorDebugPropertyFactory    = errorDebugPropertyFactory;
     _debugEngineCommands          = debugEngineCommands;
     _expressionEvaluationStrategy = expressionEvaluationStrategy;
     _expressionEvaluationRecorder = expressionEvaluationRecorder;
     _timeSource = timeSource;
 }
        public void SetUp()
        {
            logSpy = new LogSpy();
            logSpy.Attach();

            var taskContext = new JoinableTaskContext();

            commandWindowText = "";

            commandWindowMock = Substitute.For <IVsCommandWindow>();
            commandWindowMock.Print(Arg.Do <string>(x => commandWindowText += x));

            serviceProviderMock = Substitute.For <IServiceProvider>();

            yetiService = new YetiVSIService(null);

            serviceProviderMock.GetService(typeof(YetiVSIService)).Returns(yetiService);
            serviceProviderMock.GetService(typeof(SVsCommandWindow)).Returns(commandWindowMock);

            debugEngineCommandsMock = Substitute.For <IDebugEngineCommands>();

            // (internal): This needs to be a member variable since debugEngineManager tracks it
            //              by weak reference only!.
            debugEngineMock = Substitute.For <IGgpDebugEngine>();
            debugEngineMock.DebugEngineCommands.Returns(debugEngineCommandsMock);

            debugEngineManager = new DebugEngineManager();
            debugEngineManager.AddDebugEngine(debugEngineMock);

            serviceProviderMock.GetService(typeof(SDebugEngineManager))
            .Returns(debugEngineManager);

            menuCommandService = new OleMenuCommandService(serviceProviderMock);
            serviceProviderMock.GetService(typeof(IMenuCommandService))
            .Returns(menuCommandService);

            DebuggerOptionsCommand.Register(taskContext, serviceProviderMock);
        }