예제 #1
0
        public void TestAddChild()
        {
            UIThreadInvoker.Invoke((ThreadInvoker) delegate()
            {
                //Get the global service provider and the dte
                IServiceProvider sp = VsIdeTestHostContext.ServiceProvider;
                DTE dte             = (DTE)sp.GetService(typeof(DTE));

                string destination  = Path.Combine(TestContext.TestDir, TestContext.TestName);
                ProjectNode project = Utilities.CreateMyNestedProject(sp, dte, TestContext.TestName, destination, true);

                string newFileName = "output.txt";

                FileNode node = project.CreateFileNode(newFileName);
                Assert.IsNotNull(node);

                project.AddChild(node);

                Assert.IsTrue(node == project.FindChildByProjectElement(node.ItemNode));
            });
        }