public void TestNewSaturate_methylamine_radical_cation()
        {
            // test Ammonia, CH3NH3+
            Atom c = new Atom("C")
            {
                ImplicitHydrogenCount = 3
            };
            Atom n = new Atom("N")
            {
                ImplicitHydrogenCount = 3,
                FormalCharge          = +1
            };
            Bond b1 = new Bond(c, n, BondOrder.Single);

            var m = new AtomContainer();

            m.Atoms.Add(c);
            m.Atoms.Add(n);
            m.Bonds.Add(b1);

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(m);
            CDK.LonePairElectronChecker.Saturate(m);

            Assert.AreEqual(0, m.GetConnectedLonePairs(n).Count());
        }
        public void TestNewSaturate_Methyl_alcohol_protonated()
        {
            // test Methyl alcohol protonated, CH3OH2+
            Atom c1 = new Atom("C")
            {
                ImplicitHydrogenCount = 3
            };
            Atom o = new Atom("O")
            {
                FormalCharge          = +1,
                ImplicitHydrogenCount = 2
            };
            Bond b1 = new Bond(c1, o, BondOrder.Single);

            var m = new AtomContainer();

            m.Atoms.Add(c1);
            m.Atoms.Add(o);
            m.Bonds.Add(b1);

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(m);
            CDK.LonePairElectronChecker.Saturate(m);

            Assert.AreEqual(1, m.GetConnectedLonePairs(o).Count());
        }
        public void TestNewSaturate_Methyl_chloride()
        {
            // test Methyl chloride, CH3Cl
            Atom c1 = new Atom("C")
            {
                ImplicitHydrogenCount = 3
            };
            Atom cl = new Atom("Cl");
            Bond b1 = new Bond(c1, cl, BondOrder.Single);

            var m = new AtomContainer();

            m.Atoms.Add(c1);
            m.Atoms.Add(cl);
            m.Bonds.Add(b1);

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(m);
            CDK.LonePairElectronChecker.Saturate(m);
            Assert.AreEqual(3, m.GetConnectedLonePairs(cl).Count());
            Assert.AreEqual(0, m.GetConnectedLonePairs(c1).Count());
        }
        public void TestNewSaturate_Methyl_alcohol_AddH()
        {
            // test Methyl alcohol, CH3OH
            var m = new AtomContainer();

            m.Atoms.Add(new Atom("C"));
            m.Atoms.Add(new Atom("O"));
            for (int i = 0; i < 4; i++)
            {
                m.Atoms.Add(new Atom("H"));
            }

            m.AddBond(m.Atoms[0], m.Atoms[1], BondOrder.Single);
            m.AddBond(m.Atoms[0], m.Atoms[2], BondOrder.Single);
            m.AddBond(m.Atoms[0], m.Atoms[3], BondOrder.Single);
            m.AddBond(m.Atoms[0], m.Atoms[4], BondOrder.Single);
            m.AddBond(m.Atoms[1], m.Atoms[5], BondOrder.Single);
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(m);
            CDK.LonePairElectronChecker.Saturate(m);

            Assert.AreEqual(2, m.GetConnectedLonePairs(m.Atoms[1]).Count());
            Assert.AreEqual(0, m.GetConnectedLonePairs(m.Atoms[0]).Count());
        }
        public void TestNewSaturate_Ammonia()
        {
            // test Ammonia, H3N
            Atom n = new Atom("N")
            {
                ImplicitHydrogenCount = 3
            };

            var m = new AtomContainer();

            m.Atoms.Add(n);

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(m);
            CDK.LonePairElectronChecker.Saturate(m);

            Assert.AreEqual(1, m.GetConnectedLonePairs(n).Count());
        }
        public void TestNewSaturate_methoxide_anion()
        {
            // test methoxide anion, CH3O-
            Atom c1 = new Atom("C")
            {
                ImplicitHydrogenCount = 3
            };
            Atom o = new Atom("O")
            {
                FormalCharge = -1
            };
            Bond b1 = new Bond(c1, o, BondOrder.Single);

            var m = new AtomContainer();

            m.Atoms.Add(c1);
            m.Atoms.Add(o);
            m.Bonds.Add(b1);

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(m);
            CDK.LonePairElectronChecker.Saturate(m);

            Assert.AreEqual(3, m.GetConnectedLonePairs(o).Count());
        }