public void TestGetRelevantReaction_IReactionSet_IAtom()
 {
     foreach (var container in ReactionSetManipulator.GetAllAtomContainers(set))
     {
         IAtom anAtom = container.Atoms[0];
         Assert.AreEqual(set[0], ReactionSetManipulator.GetRelevantReaction(set, anAtom));
     }
 }
 public void TestGetRelevantReaction_IReactionSet_IBond()
 {
     foreach (var container in ReactionSetManipulator.GetAllAtomContainers(set))
     {
         IBond aBond = container.Bonds[0];
         Assert.AreEqual(set[0], ReactionSetManipulator.GetRelevantReaction(set, aBond));
     }
 }
示例#3
0
        /// <summary>
        /// Retrieves the first IReaction containing a given IAtom from an
        /// IChemModel.
        /// </summary>
        /// <param name="chemModel">The IChemModel object.</param>
        /// <param name="atom">The IAtom object to search.</param>
        /// <returns>The IAtomContainer object found, null if none is found.</returns>
        public static IReaction GetRelevantReaction(IChemModel chemModel, IAtom atom)
        {
            IReaction reaction = null;

            if (chemModel.ReactionSet != null)
            {
                IReactionSet reactionSet = chemModel.ReactionSet;
                reaction = ReactionSetManipulator.GetRelevantReaction(reactionSet, atom);
            }
            return(reaction);
        }