private StubVsUIShell.StubWindowFrame CreateAndRegisterFrame() { var frame = new StubVsUIShell.StubWindowFrame(); var uiShell = new StubVsUIShell { FindToolWindowAction = (windowSlotGuid) => { windowSlotGuid.Should().Be(VSConstants.StandardToolWindows.Output, "Unexpected window slot guid"); return(frame); } }; this.serviceProvider.RegisterService(typeof(SVsUIShell), uiShell); return(frame); }
public void VsOutputWindowPaneNotifier_MessageOnly() { // Arrange bool logFullException = true; bool ensureOutputVisible = false; StubVsOutputWindowPane outputPane = this.CreateOutputPane(logFullException); StubVsUIShell.StubWindowFrame frame = this.CreateAndRegisterFrame(); IProgressErrorNotifier testSubject = this.CreateTestSubject(outputPane, ensureOutputVisible, logFullException); // Act testSubject.Notify(this.expectedException); // Assert frame.WasShown.Should().BeFalse(); outputPane.IsActivated.Should().BeFalse(); outputPane.IsWrittenToOutputWindow.Should().BeTrue(); }
public void VsOutputWindowPaneNotifier_FullException() { // Setup bool logFullException = true; bool ensureOutputVisible = false; StubVsOutputWindowPane outputPane = this.CreateOutputPane(logFullException); StubVsUIShell.StubWindowFrame frame = this.CreateAndRegisterFrame(); IProgressErrorNotifier testSubject = this.CreateTestSubject(outputPane, ensureOutputVisible, logFullException); // Execute testSubject.Notify(this.expectedException); // Verify frame.AssertNotShown(); outputPane.AssertNotActivated(); outputPane.AssertWrittenToOutputWindow(); }
private StubVsUIShell.StubWindowFrame CreateAndRegisterFrame() { var frame = new StubVsUIShell.StubWindowFrame(); var uiShell = new StubVsUIShell { FindToolWindowAction = (windowSlotGuid) => { Assert.AreEqual(VSConstants.StandardToolWindows.Output, windowSlotGuid, "Unexpected window slot guid"); return frame; } }; this.serviceProvider.RegisterService(typeof(SVsUIShell), uiShell); return frame; }