public void AddItemWithEmptyNameThrows()
 {
     ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
     string itemName = ".cs";
     string fullItemName = new FileInfo(itemName).FullName;
     projectNode.AddItem(itemName);
 }
 public void AddItemWithNullNameThrows()
 {
     ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
     projectNode.AddItem(null);
 }
 public void AddItemWithInvalidNameThrows()
 {
     ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
     string itemName = "Invalid<Name>";
     projectNode.AddItem(itemName);
 }
 public void TestOpenItem()
 {
     ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
     string itemName = "item1.cs";
     HierarchyNode item = projectNode.AddItem(itemName);
     IVsWindowFrame wnd = projectNode.OpenItem(item);
     Assert.IsNotNull(wnd);
 }
 public void TestGetMSBuildItem()
 {
     ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
     string itemName = "item1.cs";
     Assert.IsNotNull(projectNode.AddItem(itemName));
     Assert.IsNotNull(projectNode.GetBuildItem(itemName));
     string itemName2 = ".\\item2.cs";
     Assert.IsNotNull(projectNode.AddItem(itemName2));
     Assert.IsNotNull(projectNode.GetBuildItem(itemName2));
     string itemName3 = ".\\FolderForItem3\\item3.cs";
     Assert.IsNotNull(projectNode.AddItem(itemName3));
     Assert.IsNotNull(projectNode.GetBuildItem(itemName3));
     string itemName4 = "FolderForItem4\\item4.cs";
     Assert.IsNotNull(projectNode.AddItem(itemName4));
     Assert.IsNotNull(projectNode.GetBuildItem(itemName4));
 }
 public void TestAddItem()
 {
     ProjectNode projectNode = new ProjectNode(vsSolution, project.GUID);
     string itemName = "item1.cs";
     projectNode.AddItem(itemName);
     string fullItemName = new FileInfo(itemName).FullName;
     Assert.IsTrue(project.Children.Contains(fullItemName));
 }
 public void RemoveItem()
 {
     MockVSHierarchy hierarchy = new MockVSHierarchy();
     MockVsSolution solution = new MockVsSolution(hierarchy);
     MockVSHierarchy project = new MockVSHierarchy("Project1.project");
     hierarchy.AddProject(project);
     ProjectNode projectNode = new ProjectNode(solution, project.GUID);
     string itemName = "item1";
     HierarchyNode node = projectNode.AddItem(itemName);
     Assert.IsNotNull(projectNode.FindByName(itemName));
     node.Remove();
     Assert.IsNull(projectNode.FindByName(itemName));
 }