public void FacetHierachy_Test_Get_Parent_Of_A_Facet() { var childFacet = new SimpleFacet("childFacet"); var parentFacet = new HierarchicalFacet("parentFacet"); parentFacet.Child = childFacet; var facets = new List<IFacet> { childFacet, parentFacet }; var facetHierarchy = new FacetHierarchy { Facets = facets }; Assert.IsTrue(facetHierarchy.ParentOf("childFacet").Name == "parentFacet"); }
public void FacetHierachy_Test_Get_Parent_Of_A_Facet_That_Has_A_Parent() { var childFacet = new SimpleFacet("childFacet"); var parentFacet1 = new HierarchicalFacet(("parentFacet1")); var parentFacet2 = new HierarchicalFacet("parentFacet2") { Child = parentFacet1 }; parentFacet1.Child = childFacet; var facets = new List<IFacet> { childFacet, parentFacet1, parentFacet2 }; var facetHierarchy = new FacetHierarchy { Facets = facets }; Assert.IsTrue(facetHierarchy.ParentOf("childFacet").Name == "parentFacet1"); Assert.IsTrue(facetHierarchy.ParentOf("parentFacet1").Name == "parentFacet2"); }