コード例 #1
0
        public override void TestClone()
        {
            IBond  bond  = (IBond)NewChemObject();
            object clone = bond.Clone();

            Assert.IsNotNull(clone);
            Assert.IsTrue(clone is IBond);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: BondRef.cs プロジェクト: qize/NCDK
 /// <inheritdoc/>
 public override ICDKObject Clone(CDKObjectMap map)
 {
     return(bond.Clone(map));
 }