public void TestIsValidSum_IMolecularFormula() { var formula = new MolecularFormula(); formula.Add(ifac.GetMajorIsotope("C"), 1); formula.Add(ifac.GetMajorIsotope("H"), 100); List <IRule> rules = new List <IRule> { new MMElementRule() }; MolecularFormulaChecker MFChecker = new MolecularFormulaChecker(rules); Assert.AreEqual(0.0, MFChecker.IsValidSum(formula), 0.001); }
public void TestIsValid_NOT() { var formula = new MolecularFormula(); formula.Add(ifac.GetMajorIsotope("C"), 1); formula.Add(ifac.GetMajorIsotope("H"), 100); List <IRule> rules = new List <IRule> { new MMElementRule() }; MolecularFormulaChecker MFChecker = new MolecularFormulaChecker(rules); IMolecularFormula formulaWith = MFChecker.IsValid(formula); Assert.AreEqual(0.0, formulaWith.GetProperty <double>((new MMElementRule()).GetType().ToString())); }
public void TestGetRules() { MolecularFormulaChecker MFChecker = new MolecularFormulaChecker(new List <IRule>()); Assert.IsNotNull(MFChecker.Rules); }