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); }
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); }
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); }
public void TestConfigure_IAtom_Null() { var atom = new Atom(ChemicalElement.C); IAtomType atomType = null; try { AtomTypeManipulator.Configure(atom, atomType); Assert.Fail(); } catch (ArgumentNullException) { } }
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); }
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); }