public void TestGetRDBEValue_IMolecularFormula() { RDBERule rule = new RDBERule(); IMolecularFormula formula = MolecularFormulaManipulator.GetMajorIsotopeMolecularFormula("C2H4", builder); Assert.AreEqual(1.0, rule.GetRDBEValue(formula)[0], 0.0001); }
public void Test1() { RDBERule rule = new RDBERule(); IMolecularFormula formula = MolecularFormulaManipulator.GetMajorIsotopeMolecularFormula("C3H8O3S2", builder); var value = rule.GetRDBEValue(formula); Assert.AreEqual(6, value.Count, 0.0001); Assert.AreEqual(0.0, value[0], 0.0001); Assert.AreEqual(1.0, rule.Validate(formula), 0.0001); }
public void TestDefaultValidFalse_SetParam() { RDBERule rule = new RDBERule(); IMolecularFormula formula = MolecularFormulaManipulator.GetMajorIsotopeMolecularFormula("CH2F10S2", builder); var value = rule.GetRDBEValue(formula); Assert.AreEqual(6, value.Count, 0.0001); Assert.AreEqual(-4.0, value[0], 0.0001); Assert.AreEqual(-3.0, value[1], 0.0001); Assert.AreEqual(-2.0, value[2], 0.0001); Assert.AreEqual(-2.0, value[3], 0.0001); Assert.AreEqual(-1.0, value[4], 0.0001); Assert.AreEqual(0.0, value[5], 0.0001); Assert.AreEqual(1.0, rule.Validate(formula), 0.0001); }