public void ShouldFilterOutChildren() { MockHierarchyNode solutionNode = new MockHierarchyNode { IsSolution = true }; MockHierarchyNode projectNode = new MockHierarchyNode { ExtObject = new MockProject() }; MockHierarchyNode itemNode = new MockHierarchyNode { ExtObject = new object() }; OnlyProjectsFilter target = new OnlyProjectsFilter(); Assert.IsFalse(target.Filter(solutionNode)); Assert.IsTrue(target.Filter(itemNode)); Assert.IsFalse(target.Filter(projectNode)); }
public void ShouldFilterOutChildren() { MockVSHierarchy root = new MockVSHierarchy(); MockVsSolution solution = new MockVsSolution(root); string childName = "Child1.txt"; root.AddChild(childName); string projectName = "Project1.project"; MockVSHierarchy project = new MockVSHierarchy(projectName); root.AddProject(project); HierarchyNode slnNode = new HierarchyNode(solution); HierarchyNode projectNode = new HierarchyNode(solution, project.GUID); HierarchyNode childNode = slnNode.FindByName(childName); OnlyProjectsFilter target = new OnlyProjectsFilter(); Assert.IsFalse(target.Filter(slnNode)); Assert.IsTrue(target.Filter(childNode)); Assert.IsFalse(target.Filter(projectNode)); }