public override void TestClone() { IReactionSet reactionSet = (IReactionSet)NewChemObject(); object clone = reactionSet.Clone(); Assert.IsTrue(clone is IReactionSet); }
public override ICDKObject Clone(CDKObjectMap map) { ChemModel clone = (ChemModel)base.Clone(map); clone.setOfMolecules = (IChemObjectSet <IAtomContainer>)setOfMolecules?.Clone(map); clone.setOfReactions = (IReactionSet)setOfReactions?.Clone(map); clone.ringSet = (IRingSet)ringSet?.Clone(map); clone.crystal = (ICrystal)crystal?.Clone(map); return(clone); }
public virtual void TestClone_Reaction() { IReactionSet reactionSet = (IReactionSet)NewChemObject(); reactionSet.Add(reactionSet.Builder.NewReaction()); // 1 reactionSet.Add(reactionSet.Builder.NewReaction()); // 2 reactionSet.Add(reactionSet.Builder.NewReaction()); // 3 reactionSet.Add(reactionSet.Builder.NewReaction()); // 4 IReactionSet clone = (IReactionSet)reactionSet.Clone(); Assert.AreEqual(reactionSet.Count, clone.Count); for (int f = 0; f < reactionSet.Count; f++) { for (int g = 0; g < clone.Count; g++) { Assert.IsNotNull(reactionSet[f]); Assert.IsNotNull(clone[g]); Assert.AreNotSame(reactionSet[f], clone[g]); } } }