Ejemplo n.º 1
0
        public void TestConfigureUnSetProperties()
        {
            IAtom     atom     = new Atom(ChemicalElement.C);
            IAtomType atomType = new AtomType(ChemicalElement.C)
            {
                ExactMass = 12.0
            };

            AtomTypeManipulator.ConfigureUnsetProperties(atom, atomType);
            Assert.AreEqual(12.0, atom.ExactMass.Value, 0.1);
        }
Ejemplo n.º 2
0
        public void TestConfigure_IAtom_IAtomType()
        {
            IAtom     atom     = new Atom(ChemicalElement.C);
            IAtomType atomType = new AtomType(ChemicalElement.C)
            {
                IsHydrogenBondAcceptor = true
            };

            AtomTypeManipulator.Configure(atom, atomType);
            Assert.AreEqual(atomType.IsHydrogenBondAcceptor, atom.IsHydrogenBondAcceptor);
        }
Ejemplo n.º 3
0
        public void UnknownAtomTypeDoesNotModifyProperties()
        {
            IAtom     atom     = new Atom(ChemicalElement.C);
            IAtomType atomType = new AtomType(ChemicalElement.R)
            {
                AtomTypeName = "X"
            };

            AtomTypeManipulator.Configure(atom, atomType);
            Assert.AreEqual("C", atom.Symbol);
            Assert.AreEqual(6, atom.AtomicNumber);
        }
Ejemplo n.º 4
0
        public void TestConfigure_IAtom_Null()
        {
            var       atom     = new Atom(ChemicalElement.C);
            IAtomType atomType = null;

            try
            {
                AtomTypeManipulator.Configure(atom, atomType);
                Assert.Fail();
            }
            catch (ArgumentNullException)
            {
            }
        }
Ejemplo n.º 5
0
        public void AromaticitySetIfForType()
        {
            IAtom atom = new Atom(ChemicalElement.C)
            {
                IsAromatic = false
            };
            IAtomType atomType = new AtomType(ChemicalElement.R)
            {
                IsAromatic   = true,
                AtomTypeName = "C.am"
            };

            AtomTypeManipulator.Configure(atom, atomType);
            Assert.IsTrue(atom.IsAromatic);
        }
Ejemplo n.º 6
0
        public void AromaticityIsNotOverwritten()
        {
            IAtom atom = new Atom(ChemicalElement.C)
            {
                IsAromatic = true
            };
            IAtomType atomType = new AtomType(ChemicalElement.R)
            {
                IsAromatic   = false,
                AtomTypeName = "C.sp3"
            };

            AtomTypeManipulator.Configure(atom, atomType);
            Assert.IsTrue(atom.IsAromatic);
        }