public static IAtomContainer ResetFlags(IAtomContainer ac)
 {
     for (int f = 0; f < ac.Atoms.Count; f++)
     {
         ac.Atoms[f].IsVisited = false;
     }
     foreach (var ec in ac.GetElectronContainers())
     {
         ec.IsVisited = false;
     }
     return(ac);
 }
Exemple #2
0
        public void TestSpinMultiplicity()
        {
            var  mol  = new AtomContainer();
            Atom atom = new Atom("C");

            mol.Atoms.Add(atom);
            mol.SingleElectrons.Add(new SingleElectron(atom));

            IAtomContainer roundTrippedMol = CMLRoundTripTool.RoundTripMolecule(convertor, mol);

            Assert.AreEqual(1, roundTrippedMol.Atoms.Count);
            Assert.AreEqual(1, roundTrippedMol.GetElectronContainers().Count());
            IAtom roundTrippedAtom = roundTrippedMol.Atoms[0];

            Assert.AreEqual(1, roundTrippedMol.GetConnectedSingleElectrons(roundTrippedAtom).Count());
        }