public void GetTypeIdIdDependencies_Test() { string targets = localPath + targetList; string localConcept = localPath + localConceptFile; string xRelationship = path + statedRelationshipFile; RF2Reader r = new RF2Reader(); List <string> extractTargets = r.ReadListOfIds(targets); List <Concept> localConcepts = r.ReadConceptFile(localConcept, true, false); List <Relationship> localRelationships = r.ReadRelationshipFile(xRelationship); // initial number of concepts to extract int initialTargets = extractTargets.Count(); //look for dependencies var dependencies = r.GetTypeIdIdDependencies(extractTargets, localConcepts, localRelationships); //while there are dependencies, add them to the list, and look for more. while (dependencies.Count() > 0) { extractTargets.InsertRange(0, dependencies); dependencies = r.GetTypeIdIdDependencies(extractTargets, localConcepts, localRelationships); } // number of dependencies found is the final number to extract - the initial; int identifiedDependencycount = extractTargets.Count() - initialTargets; Assert.AreEqual(1, identifiedDependencycount); }
public void ReadListOfIds_Test() { string testFile = localPath + targetList; RF2Reader r = new RF2Reader(); var ids = r.ReadListOfIds(testFile); Assert.AreEqual(3, ids.Count()); }
public void IdentifyAllDependencies_Test() { string targets = localPath + targetList; string localConcept = localPath + localConceptFile; string sRelationship = path + statedRelationshipFile; string iRelationship = path + inferredRelationshipFile; RF2Reader r = new RF2Reader(); List <string> extractTargets = r.ReadListOfIds(targets); List <Concept> localConcepts = r.ReadConceptFile(localConcept, true, false); List <Relationship> statedRelationships = r.ReadRelationshipFile(sRelationship); List <Relationship> inferredRelationships = r.ReadRelationshipFile(iRelationship); var allDependencies = r.IdentifyAllDependencies(extractTargets, localConcepts, statedRelationships, inferredRelationships); Assert.AreEqual(2, allDependencies.Count()); }
public void IdentifyDependencies_Test() { string targets = localPath + targetList; string localConcept = localPath + localConceptFile; string statedRelationships = path + statedRelationshipFile; string inferredRelationships = path + inferredRelationshipFile; RF2Reader r = new RF2Reader(); List <string> extractTargets = r.ReadListOfIds(targets); List <Concept> localConcepts = r.ReadConceptFile(localConcept, true, false); List <Relationship> statedRels = r.ReadRelationshipFile(statedRelationships); List <Relationship> inferredRels = r.ReadRelationshipFile(inferredRelationships); //look for dependencies (both DestinationId + TypeId) var dependencies = r.IdentifyDependencies(extractTargets, localConcepts, statedRels); Assert.AreEqual(2, dependencies.Count()); }