Example #1
0
        public void TestIsEmpty_MoleculeSet()
        {
            IChemModel chemModel = (IChemModel)NewChemObject();
            IChemObjectBuilder builder = chemModel.Builder;

            Assert.IsNotNull(chemModel);
            Assert.IsTrue(chemModel.IsEmpty());

            IAtom atom = builder.NewAtom();
            IAtomContainer mol = builder.NewAtomContainer();
            IChemObjectSet<IAtomContainer> mset = builder.NewAtomContainerSet();

            mol.Atoms.Add(atom);
            mset.Add(mol);
            chemModel.MoleculeSet = mset;
            Assert.IsFalse(chemModel.IsEmpty(), "chem model with a molecule set should not be empty");
            mol.Atoms.Remove(atom);
            Assert.IsFalse(chemModel.IsEmpty(), "chem model with a (empty) molecule set should not be empty");
            chemModel.MoleculeSet = null;
            Assert.IsTrue(chemModel.IsEmpty(), "chemo model with no molecule set should be empty");
        }
Example #2
0
 public void TestIsEmpty()
 {
     IChemModel chemModel = (IChemModel)NewChemObject();
     Assert.IsTrue(chemModel.IsEmpty(), "new chem model is empty");
 }