예제 #1
0
        public void TestDefaultValidFalse()
        {
            IRule rule = new RDBERule();

            IMolecularFormula formula = MolecularFormulaManipulator.GetMajorIsotopeMolecularFormula("C2H4", builder);

            Assert.AreEqual(1.0, rule.Validate(formula), 0.0001);
        }
예제 #2
0
        public void TestAnticipatedIonState_2()
        {
            RDBERule rule = new RDBERule();

            IMolecularFormula formula = MolecularFormulaManipulator.GetMajorIsotopeMolecularFormula("NH4", builder);

            Assert.AreEqual(0.0, rule.Validate(formula), 0.0001);
        }
예제 #3
0
        public void Test2()
        {
            RDBERule rule = new RDBERule();

            IMolecularFormula formula = MolecularFormulaManipulator.GetMajorIsotopeMolecularFormula("C4H8O3S1", builder);

            Assert.AreEqual(1.0, rule.Validate(formula), 0.0001);
        }
예제 #4
0
        public void TestValidate_IMolecularFormula_Double()
        {
            RDBERule rule = new RDBERule();

            IMolecularFormula formula = MolecularFormulaManipulator.GetMajorIsotopeMolecularFormula("C2H4", builder);

            Assert.IsTrue(rule.Validate(formula, 2.0));
        }
예제 #5
0
        public void TestGetRDBEValue_IMolecularFormula()
        {
            RDBERule rule = new RDBERule();

            IMolecularFormula formula = MolecularFormulaManipulator.GetMajorIsotopeMolecularFormula("C2H4", builder);

            Assert.AreEqual(1.0, rule.GetRDBEValue(formula)[0], 0.0001);
        }
예제 #6
0
        public void TestB()
        {
            RDBERule rule = new RDBERule();

            IMolecularFormula formula = MolecularFormulaManipulator.GetMajorIsotopeMolecularFormula("C6H9BNO2", builder);

            formula.Charge = 1;

            Assert.AreEqual(1.0, rule.Validate(formula), 0.0001);
        }
예제 #7
0
        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);
        }
예제 #8
0
        public void TestDefault()
        {
            IRule rule    = new RDBERule();
            var   objects = rule.Parameters;

            Assert.AreEqual(2, objects.Count);

            double min = (double)objects[0];
            double max = (double)objects[1];

            Assert.AreEqual(-0.5, min, 0.00001);
            Assert.AreEqual(30, max, 0.00001);
        }
예제 #9
0
        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);
        }
예제 #10
0
        public void TestSetParameters()
        {
            IRule rule = new RDBERule();

            object[] parameters = new object[2];

            parameters[0]   = 0.0;
            parameters[1]   = 10.0;
            rule.Parameters = parameters;

            var objects = rule.Parameters;

            Assert.AreEqual(2, objects.Count);

            double min = (double)objects[0];
            double max = (double)objects[1];

            Assert.AreEqual(0.0, min, 0.00001);
            Assert.AreEqual(10.0, max, 0.00001);
        }
예제 #11
0
        public void TestRDBERule()
        {
            IRule rule = new RDBERule();

            Assert.IsNotNull(rule);
        }