public void CanHideWithSmartPart() { TestableRootWorkItem workItem = new TestableRootWorkItem(); WindowWorkspace workspace = workItem.Workspaces.AddNew <WindowWorkspace>(); MockSmartPart smartPart = workItem.SmartParts.AddNew <MockSmartPart>(); workspace.Show(smartPart); workspace.Hide(smartPart); Assert.IsFalse(workspace.Windows[smartPart].Visible); Assert.IsFalse(smartPart.Visible); }
public void CanShowSameWindowAfterHidden() { TestableRootWorkItem workItem = new TestableRootWorkItem(); WindowWorkspace workspace = workItem.Workspaces.AddNew <WindowWorkspace>(); MockSmartPart smartPart = workItem.SmartParts.AddNew <MockSmartPart>(); workspace.Show(smartPart); workspace.Hide(smartPart); workspace.Show(smartPart); Assert.IsNotNull(workspace.Windows[smartPart]); Assert.IsTrue(smartPart.Visible); }
public void CanShowSameWindowAfterHidden() { TestableRootWorkItem workItem = new TestableRootWorkItem(); WindowWorkspace workspace = workItem.Workspaces.AddNew <WindowWorkspace>(); MockWPFSmartPart smartPart = workItem.SmartParts.AddNew <MockWPFSmartPart>(); workspace.Show(smartPart); workspace.Hide(smartPart); workspace.Show(smartPart); Assert.IsNotNull(workspace.Windows[smartPart.ElementHost]); //Assert.IsTrue(smartPart.Visible); Assert.AreNotEqual(System.Windows.Visibility.Hidden, smartPart.Visibility); workspace.Windows[smartPart.ElementHost].Close(); }
public void CanHideWithSmartPart() { TestableRootWorkItem workItem = new TestableRootWorkItem(); WindowWorkspace workspace = workItem.Workspaces.AddNew <WindowWorkspace>(); MockWPFSmartPart smartPart = workItem.SmartParts.AddNew <MockWPFSmartPart>(); workspace.Show(smartPart); workspace.Hide(smartPart); Assert.IsFalse(workspace.Windows[smartPart.ElementHost].Visible); Assert.IsFalse(smartPart.ElementHost.Visible); // Hosted UIElement doesn't get Visibility property set upon ElementHost Visible change // Assert.AreNotEqual(System.Windows.Visibility.Visible, smartPart.Visibility); workspace.Windows[smartPart.ElementHost].Close(); }
public void HidingSmartPartDoesNotAutomaticallyShowPreviousForm() { TestableRootWorkItem workItem = new TestableRootWorkItem(); WindowWorkspace workspace = workItem.Workspaces.AddNew <WindowWorkspace>(); MockWPFSmartPart smartPartA = workItem.SmartParts.AddNew <MockWPFSmartPart>(); smartPartA.Visibility = System.Windows.Visibility.Hidden; MockWPFSmartPart smartPartB = workItem.SmartParts.AddNew <MockWPFSmartPart>(); smartPartB.Visibility = System.Windows.Visibility.Hidden; 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); Assert.AreNotEqual(System.Windows.Visibility.Hidden, smartPartA.Visibility); // 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.ElementHost].Hide(); workspace.Show(smartPartB, smartPartInfoB); //Assert.IsTrue(smartPartB.Visible); Assert.AreNotEqual(System.Windows.Visibility.Hidden, smartPartB.Visibility); workspace.Hide(smartPartB); Assert.IsNull(workspace.ActiveSmartPart); }