示例#1
0
        public void WorkspaceShowsCorrectTabFromWorkItem()
        {
            WorkItem      childWI  = workItem.Items.AddNew <WorkItem>();
            MockSmartPart parentSP = workItem.Items.AddNew <MockSmartPart>("SP");
            MockSmartPart childSP  = childWI.Items.AddNew <MockSmartPart>("SP");
            TabWorkspace  tabWS    = workItem.Items.AddNew <TabWorkspace>("TabWS");

            tabWS.Show(parentSP);
            tabWS.Show(childSP);

            tabWS.Show(parentSP);

            Assert.AreEqual(2, tabWS.TabPages.Count);
            Assert.AreSame(tabWS.TabPages[0], tabWS.SelectedTab);
        }
示例#2
0
        public void TabIsRemovedWhenWorkItemIsDisposed()
        {
            TabWorkspace workspace = new TabWorkspace();

            workItem.Items.Add(workspace);

            workItem.Workspaces.Add(workspace, "TabWorkspace");

            WorkItem child     = workItem.Items.AddNew <WorkItem>();
            Control  smartPart = new Control();

            child.Items.Add(smartPart);

            TabWorkspace myWS = (TabWorkspace)child.Workspaces["TabWorkspace"];

            myWS.Show(smartPart);

            Assert.AreEqual(1, workspace.TabCount);
            Assert.IsTrue(workspace.Contains(smartPart));

            child.Dispose();

            Assert.IsFalse(workspace.Contains(smartPart));
            Assert.AreEqual(0, workspace.TabCount);
        }