public override void TestClone() { IBond bond = (IBond)NewChemObject(); object clone = bond.Clone(); Assert.IsNotNull(clone); Assert.IsTrue(clone is IBond); }
public virtual void TestClone_Stereo() { IChemObject obj = NewChemObject(); IAtom atom1 = obj.Builder.NewAtom("C"); IAtom atom2 = obj.Builder.NewAtom("O"); IBond bond = obj.Builder.NewBond(atom1, atom2, BondOrder.Single, BondStereo.Up); IBond clone = (IBond)bond.Clone(); // test cloning of bond order bond.Stereo = BondStereo.UpInverted; Assert.AreEqual(BondStereo.Up, clone.Stereo); }
public virtual void TestClone_Order() { IChemObject obj = NewChemObject(); IAtom atom1 = obj.Builder.NewAtom("C"); IAtom atom2 = obj.Builder.NewAtom("O"); IBond bond = obj.Builder.NewBond(atom1, atom2, BondOrder.Single); IBond clone = (IBond)bond.Clone(); // test cloning of bond order bond.Order = BondOrder.Double; Assert.AreEqual(BondOrder.Single, clone.Order); }
public virtual void TestClone_IAtom() { IChemObject obj = NewChemObject(); IAtom atom1 = obj.Builder.NewAtom("C"); IAtom atom2 = obj.Builder.NewAtom("O"); IBond bond = obj.Builder.NewBond(atom1, atom2); IBond clone = (IBond)bond.Clone(); // test cloning of atoms Assert.AreNotSame(atom1, clone.Begin); Assert.AreNotSame(atom2, clone.End); }
/// <inheritdoc/> public override ICDKObject Clone(CDKObjectMap map) { return(bond.Clone(map)); }