public void TestRemoveAtomAndConnectedElectronContainers_IAtomContainerSet_IAtom()
        {
            var ms  = builder.NewChemObjectSet <IAtomContainer>();
            var mol = builder.NewAtomContainer();

            mol.Atoms.Add(builder.NewAtom("O"));
            mol.Atoms.Add(builder.NewAtom("O"));
            mol.AddBond(mol.Atoms[0], mol.Atoms[1], BondOrder.Double);
            var atom = mol.Atoms[0];

            ms.Add(mol);
            var otherAtom = builder.NewAtom("O");

            AtomContainerSetManipulator.RemoveAtomAndConnectedElectronContainers(ms, otherAtom);
            Assert.AreEqual(1, AtomContainerSetManipulator.GetBondCount(ms));
            Assert.AreEqual(2, AtomContainerSetManipulator.GetAtomCount(ms));
            AtomContainerSetManipulator.RemoveAtomAndConnectedElectronContainers(ms, atom);
            Assert.AreEqual(0, AtomContainerSetManipulator.GetBondCount(ms));
            Assert.AreEqual(1, AtomContainerSetManipulator.GetAtomCount(ms));
        }
Ejemplo n.º 2
0
 public static int GetAtomCount(IChemObjectSet <IAtomContainer> set)
 {
     return(AtomContainerSetManipulator.GetAtomCount(set));
 }
        public void TestGetAtomCount_IAtomContainerSet()
        {
            var count = AtomContainerSetManipulator.GetAtomCount(som);

            Assert.AreEqual(3, count);
        }