예제 #1
0
        public void HidingSmartPartDoesNotAutomaticallyShowPreviousForm()
        {
            TestableRootWorkItem workItem   = new TestableRootWorkItem();
            WindowWorkspace      workspace  = workItem.Workspaces.AddNew <WindowWorkspace>();
            MockSmartPart        smartPartA = new MockSmartPart();

            smartPartA.Visible = false;
            MockSmartPart smartPartB = new MockSmartPart();

            smartPartB.Visible = false;

            WindowSmartPartInfo smartPartInfoB = new WindowSmartPartInfo();

            smartPartInfoB.Title = "Window SmartPart B";

            WindowSmartPartInfo smartPartInfoA = new WindowSmartPartInfo();

            smartPartInfoA.Title = "Window SmartPart A";

            workspace.Show(smartPartA, smartPartInfoA);
            Assert.IsTrue(smartPartA.Visible);

            // Force the form to non-visible so it doesn't fire
            // his own Activated event after we hide the following
            // smart part, therefore making the condition impossible
            // to test.

            workspace.Windows[smartPartA].Hide();

            workspace.Show(smartPartB, smartPartInfoB);
            Assert.IsTrue(smartPartB.Visible);

            workspace.Hide(smartPartB);

            Assert.IsNull(workspace.ActiveSmartPart);
        }