示例#1
0
        public void Negative_Formula_Gives_Negative_Mass()
        {
            string formula = "C-6H-12O-6";
            var    chem    = new ChemicalFormula(formula);

            Assert.AreEqual(-180.15600, chem.AverageMass(), 0.0002);
        }
示例#2
0
        public void Empty_String()
        {
            string formula = "";
            var    chem    = new ChemicalFormula(formula);

            Assert.AreEqual(0, chem.AverageMass());
        }
示例#3
0
 public void Correct_MW_From_Valid_Formula_Carbonic()
 {
     // Carbonic - mMass results
     Assert.AreEqual(28852.3882, carbonic.MonoisotopicMass(), 0.0001);
     Assert.AreEqual(28869.9095, carbonic.AverageMass(), 0.1);
 }
示例#4
0
 public void Correct_MW_From_Valid_Formula_Peptide()
 {
     // Obtained from PubChem
     Assert.AreEqual(1982.142529, ubiquitin.MonoisotopicMass(), 0.00002);
     Assert.AreEqual(1983.34, ubiquitin.AverageMass(), 0.1);
 }
示例#5
0
 public void Correct_MW_From_Valid_Formula_Penicillin()
 {
     // Obtained from PubChem https://pubchem.ncbi.nlm.nih.gov/compound/5904#section=Chemical-and-Physical-Properties
     Assert.AreEqual(334.098728, penicillin.MonoisotopicMass(), 0.00002);
     Assert.AreEqual(334.39, penicillin.AverageMass(), 0.02);
 }
示例#6
0
 public void Correct_MW_From_Valid_Formula_Glucose()
 {
     // Obtained from PubChem https://pubchem.ncbi.nlm.nih.gov/compound/aldehydo-D-glucose#section=Chemical-and-Physical-Properties
     Assert.AreEqual(180.063388, glucose.MonoisotopicMass(), 0.00002);
     Assert.AreEqual(180.15600, glucose.AverageMass(), 0.0002);
 }