Exemplo n.º 1
0
        public virtual void TestMultiCenterCompare()
        {
            IChemObject obj   = NewChemObject();
            IAtom       atom1 = obj.Builder.NewAtom("C");
            IAtom       atom2 = obj.Builder.NewAtom("O");
            IAtom       atom3 = obj.Builder.NewAtom("C");

            IBond bond1 = obj.Builder.NewBond(new IAtom[] { atom1, atom2, atom3 });
            IBond bond2 = obj.Builder.NewBond(new IAtom[] { atom1, atom2, atom3 });

            Assert.IsTrue(bond1.Compare(bond2));

            IAtom atom4 = obj.Builder.NewAtom("C");
            IBond bond3 = obj.Builder.NewBond(new IAtom[] { atom1, atom2, atom4 });

            Assert.IsFalse(bond1.Compare(bond3));
        }
Exemplo n.º 2
0
        public override void TestCompare_Object()
        {
            IBond b = (IBond)NewChemObject();
            IAtom c = b.Builder.NewAtom("C");
            IAtom o = b.Builder.NewAtom("O");

            b.SetAtoms(new[] { c, o });
            b.Order = BondOrder.Single;

            IBond b2 = (IBond)NewChemObject();

            b2.SetAtoms(new[] { c, o });
            b2.Order = BondOrder.Single;

            Assert.IsTrue(b.Compare(b2));
        }
Exemplo n.º 3
0
Arquivo: BondRef.cs Projeto: qize/NCDK
 /// <inheritdoc/>
 public override bool Compare(object obj)
 {
     return(bond.Compare(obj));
 }