public void TestGetAllIDs_IChemSequence()
        {
            Assert.AreEqual(0, ChemSequenceManipulator.GetAllIDs(chemSequence).Count());
            IDCreator.CreateIDs(chemSequence);
            var allIDs = ChemSequenceManipulator.GetAllIDs(chemSequence);

            Assert.AreEqual(18, ChemSequenceManipulator.GetAllIDs(chemSequence).Count());
            var uniq = new HashSet <string>(allIDs);

            Assert.AreEqual(12, uniq.Count);
        }
Beispiel #2
0
 public static IEnumerable <string> GetAllIDs(IChemFile file)
 {
     if (file.Id != null)
     {
         yield return(file.Id);
     }
     foreach (var sequence in file)
     {
         foreach (var id in ChemSequenceManipulator.GetAllIDs(sequence))
         {
             yield return(id);
         }
     }
     yield break;
 }