public void CloseTabPageAddedAtDesignTime()
        {
            // Create new instance to simulate design-time creation.
            workspace = new TabWorkspace();
            workItem.Items.Add(workspace);
            MockWPFSmartPart sp1 = new MockWPFSmartPart();

            workItem.Items.Add(sp1);

            TabPage page = new TabPage();
            IWPFUIElementAdapter catalog = workItem.Services.Get <IWPFUIElementAdapter>();
            Control wrapper = catalog.Wrap(sp1);

            page.Controls.Add(wrapper);
            page.Name = Guid.NewGuid().ToString();
            workspace.TabPages.Add(page);

            owner = new Form();
            owner.Controls.Add(workspace);
            owner.Show();

            workspace.Close(sp1);

            Assert.AreEqual(0, workspace.TabPages.Count);
        }
Example #2
0
        public void CloseTabPageAddedAtDesignTime()
        {
            // Create new instance to simulate design-time creation.
            workspace = new TabWorkspace();
            workItem.Items.Add(workspace);
            MockSmartPart sp1 = new MockSmartPart();

            workItem.Items.Add(sp1);

            TabPage page = new TabPage();

            page.Controls.Add(sp1);
            sp1.Dock  = DockStyle.Fill;
            page.Name = Guid.NewGuid().ToString();
            workspace.TabPages.Add(page);

            owner = new Form();
            owner.Controls.Add(workspace);
            owner.Show();

            workspace.Close(sp1);

            Assert.AreEqual(0, workspace.TabPages.Count);
        }