예제 #1
0
        public ProjectCommandsTest()
        {
            var connectionsProvider = VsAppShell.Current.ExportProvider.GetExportedValue <IConnectionManagerProvider>();
            var historyProvider     = VsAppShell.Current.ExportProvider.GetExportedValue <IRHistoryProvider>();
            var packagesProvider    = VsAppShell.Current.ExportProvider.GetExportedValue <IRPackageManagerProvider>();

            _interactiveWorkflowProvider = TestRInteractiveWorkflowProviderFactory.Create(connectionsProvider, historyProvider, packagesProvider);
        }
예제 #2
0
        public ReplCommandTest()
        {
            _debuggerModeTracker = new VsDebuggerModeTracker();

            _componentContainerFactory = new InteractiveWindowComponentContainerFactoryMock();
            _workflowProvider          = TestRInteractiveWorkflowProviderFactory.Create(debuggerModeTracker: _debuggerModeTracker);
            _workflow = _workflowProvider.GetOrCreate();
        }
예제 #3
0
        public ReplCommandTest()
        {
            _debuggerModeTracker = new VsDebuggerModeTracker();

            _workflowProvider = TestRInteractiveWorkflowProviderFactory.Create(
                connectionsProvider: new ConnectionManagerProvider(new TestStatusBar(), RToolsSettings.Current),
                debuggerModeTracker: _debuggerModeTracker);
            _workflow = _workflowProvider.GetOrCreate();
        }
예제 #4
0
        public ProjectCommandsTest()
        {
            var sessionProvider     = new RSessionProvider(TestCoreServices.CreateReal());
            var connectionsProvider = VsAppShell.Current.ExportProvider.GetExportedValue <IConnectionManagerProvider>();
            var historyProvider     = VsAppShell.Current.ExportProvider.GetExportedValue <IRHistoryProvider>();
            var packagesProvider    = VsAppShell.Current.ExportProvider.GetExportedValue <IRPackageManagerProvider>();

            _interactiveWorkflowProvider = TestRInteractiveWorkflowProviderFactory.Create(nameof(ProjectCommandsTest), sessionProvider, connectionsProvider, historyProvider, packagesProvider);
        }
예제 #5
0
        public ReplCommandTest()
        {
            _debuggerModeTracker = new VsDebuggerModeTracker(_coreShell);
            _coreShell.ServiceManager.AddService(new TestRToolsSettings());

            _workflowProvider = TestRInteractiveWorkflowProviderFactory.Create(
                connectionsProvider: new ConnectionManagerProvider(new TestStatusBar(), _coreShell),
                debuggerModeTracker: _debuggerModeTracker);
            _workflow = _workflowProvider.GetOrCreate();
        }
예제 #6
0
        public ReplCommandTest(IServiceContainer services)
        {
            var coreShell = services.GetService <ICoreShell>();

            _debuggerModeTracker = new VsDebuggerModeTracker(coreShell);

            _workflowProvider = TestRInteractiveWorkflowProviderFactory.Create(
                connectionsProvider: new ConnectionManagerProvider(services),
                debuggerModeTracker: _debuggerModeTracker);
            _workflow = _workflowProvider.GetOrCreate();
        }
예제 #7
0
        public void HelpTest()
        {
            var clientApp       = new RHostClientHelpTestApp();
            var historyProvider = RHistoryProviderStubFactory.CreateDefault();

            using (var hostScript = new VsRHostScript(clientApp)) {
                using (var script = new ControlTestScript(typeof(HelpWindowVisualComponent))) {
                    DoIdle(100);

                    var activeViewTrackerMock       = new ActiveTextViewTrackerMock("  plot", RContentTypeDefinition.ContentType);
                    var activeReplTrackerMock       = new ActiveRInteractiveWindowTrackerMock();
                    var sessionProvider             = VsAppShell.Current.ExportProvider.GetExportedValue <IRSessionProvider>();
                    var interactiveWorkflowProvider = TestRInteractiveWorkflowProviderFactory.Create(sessionProvider, activeTextViewTracker: activeViewTrackerMock);
                    var interactiveWorkflow         = interactiveWorkflowProvider.GetOrCreate();

                    var component = ControlWindow.Component as IHelpWindowVisualComponent;
                    component.Should().NotBeNull();

                    component.VisualTheme = "Light.css";
                    clientApp.Component   = component;

                    var view = activeViewTrackerMock.GetLastActiveTextView(RContentTypeDefinition.ContentType);

                    var cmd = new ShowHelpOnCurrentCommand(interactiveWorkflow, activeViewTrackerMock, activeReplTrackerMock);

                    cmd.Should().BeVisibleAndDisabled();
                    view.Caret.MoveTo(new SnapshotPoint(view.TextBuffer.CurrentSnapshot, 3));

                    cmd.Should().BeVisibleAndEnabled();
                    cmd.Text.Should().EndWith("plot");

                    cmd.Invoke();
                    WaitForAppReady(clientApp);

                    clientApp.Uri.IsLoopback.Should().Be(true);
                    clientApp.Uri.PathAndQuery.Should().Be("/library/graphics/html/plot.html");

                    DoIdle(500);
                }
            }
        }