public void TestRefsetMembership() { Concept concept = ConceptFinder.FindById(KNOWN_ACTIVE_CONCEPT_ID); Assert.IsNotNull(concept, "Expecting an object reference, not null"); IList <RefsetMember> memberships = concept.GetRefsetMemberships(); Assert.IsNotNull(memberships, "Expecting an object reference, not null"); Assert.IsFalse(memberships.Count == 0, "Refset should contain members"); HashSet <String> memberKeys = new HashSet <String>(); foreach (RefsetMember member in memberships) { Assert.IsNotNull(member.GetRefsetConcept(), "Refset membership missing refset concept"); Assert.IsNotNull(member.GetReferencedConcept(), "Refset membership missing referenced concept"); String key = member.GetRefsetConcept().sctId.ToString() + member.GetReferencedConcept().sctId.ToString(); if (memberKeys.Contains(key)) { Assert.Fail("Duplicate membership encounter"); } memberKeys.Add(key); } }