Ejemplo n.º 1
0
        public async Task Should_start_and_report_status()
        {
            var start = new Start();

            StartupComplete complete = await _client.Request(start, TestCancellationToken);

            var status = await _statusClient.Request(new StatusRequested(start.CorrelationId), TestCancellationToken);

            status.Status.ShouldBe(_machine.Running.Name);
        }
        public async Task Should_start_and_handle_the_status_request()
        {
            Task <StartupComplete> startupCompletedTask = null;
            await Bus.Request(InputQueueAddress, new Start("A", Guid.NewGuid()), x =>
            {
                startupCompletedTask = x.Handle <StartupComplete>();
                x.Timeout            = TestTimeout;
            }, TestCancellationToken);

            StartupComplete startupComplete = await startupCompletedTask;

            Task <Status> statusTask = null;
            await Bus.Request(InputQueueAddress, new CheckStatus("A"), x =>
            {
                statusTask = x.Handle <Status>();
                x.Timeout  = TestTimeout;
            }, TestCancellationToken);

            Status status = await statusTask;

            Assert.AreEqual("A", status.ServiceName);
        }
Ejemplo n.º 3
0
        public IDEModel(DTE dte)
        {
            this.dte = dte;

            dteEvents = this.dte.Events.DTEEvents;
            dteEvents.OnStartupComplete += () => StartupComplete?.Invoke();
            dteEvents.OnBeginShutdown   += () => ShutdownInitiated?.Invoke();

            debuggerEvents = this.dte.Events.DebuggerEvents;
            debuggerEvents.OnEnterDesignMode += (dbgEventReason e) => OnModeChanged(dbgDebugMode.dbgDesignMode);
            debuggerEvents.OnEnterRunMode    += (dbgEventReason e) => OnModeChanged(dbgDebugMode.dbgRunMode);
            debuggerEvents.OnEnterBreakMode  += (dbgEventReason e, ref dbgExecutionAction action) => OnModeChanged(dbgDebugMode.dbgBreakMode);

            VsMode = this.dte.Debugger.CurrentMode;

            // callbacks for IDE windows being opened
            var events2 = dte.Events as Events2;

            if (events2 != null)
            {
                windowVisibilityEvents = events2.WindowVisibilityEvents;
                windowVisibilityEvents.WindowShowing += (Window w) => WindowShown?.Invoke(w);
            }
        }
Ejemplo n.º 4
0
 public async Task Should_receive_the_response_message()
 {
     StartupComplete complete = await _client.Request(new Start(), TestCancellationToken);
 }