public void TestInvalidRefsetId()
        {
            List <Concept> members = ConceptFinder.FindRefsetMembers(INVALID_REFSET);

            Assert.IsNotNull(members, "Expected an empty collection, not null reference");
            Assert.IsTrue(members.Count == 0, "No members should be returned for invalid refset");
        }
        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);
            }
        }
        public void TestValidRefsetId()
        {
            List <Concept> members = ConceptFinder.FindRefsetMembers(KNOWN_REFSET);

            Assert.IsNotNull(members, "Expecting an object reference, not null");
            Assert.IsFalse(members.Count == 0, "Refset should contain members");
        }
        public void TestMaxRows()
        {
            int            resultLimit = DataSource.GetMaxRows();
            List <Concept> results     = ConceptFinder.FindByTerm("heart");

            Assert.IsFalse(results.Count > resultLimit, "Number of results returned exceeds the maximum row count specified");
        }
        public void TestUnknownTerm()
        {
            List <Concept> results = ConceptFinder.FindByTerm("wakawaka");

            Assert.IsNotNull(results, "Expected an empty collection, not null reference");
            Assert.IsTrue(results.Count == 0, "Expected no concepts for known invalid term");
        }
Пример #6
0
        public void TestKnownId()
        {
            Concept concept = ConceptFinder.FindById(KNOWN_ACTIVE_CONCEPT_ID);

            Assert.IsNotNull(concept, "Known concept not found");
            Assert.IsTrue(concept.sctId == KNOWN_ACTIVE_CONCEPT_ID, "Incorrect concept id");
            Assert.IsTrue("Fifth metatarsal structure".Equals(concept.GetPreferredTerm()), "Incorrect en-AU preferred term");
        }
        public void TestNoDuplicates()
        {
            HashSet <long> uniqueIds = new HashSet <long>();

            List <Concept> results = ConceptFinder.FindByTerm("heart");

            foreach (Concept c in results)
            {
                long sctId = c.sctId;
                Assert.IsFalse(uniqueIds.Contains(sctId), "Duplicate concept with SCTID " + sctId.ToString() + " returned in result");
                uniqueIds.Add(sctId);
            }
        }
        public void TestKnownTerm()
        {
            List <Concept> results = ConceptFinder.FindByTerm("drunk");

            Assert.IsNotNull(results, "Expected an empty collection, not null reference");
            Assert.IsFalse(results.Count == 0, "Known term not found");
            Assert.IsTrue(results.Count > 1, "Expected more than one concept found for known term");

            bool foundActive   = false;
            bool foundInactive = false;

            foreach (Concept concept in results)
            {
                foundActive   |= (concept.sctId == KNOWN_ACTIVE_CONCEPT_ID);
                foundInactive |= (concept.sctId == KNOWN_INACTIVE_CONCEPT_ID);
            }

            Assert.IsTrue(foundActive, "Expected active concept was not present in results");
            Assert.IsFalse(foundInactive, "Inactive concept was present in the result, should only contain active concepts");
        }
Пример #9
0
        public void TestInactiveConcept()
        {
            Concept concept = ConceptFinder.FindById(KNOWN_INACTIVE_CONCEPT_ID);

            Assert.IsNull(concept, "Inactive concept not expected");
        }
Пример #10
0
        public void TestUnknownId()
        {
            Concept concept = ConceptFinder.FindById(INVALID_CONCEPT_ID);

            Assert.IsNull(concept, "Unexpected concept found for invalid id");
        }