public void test_EventAssignment_setMath()
        {
            ASTNode math = libsbml.parseFormula("2 * k");
            string  formula;
            ASTNode math1;

            EA.setMath(math);
            math1 = EA.getMath();
            assertTrue(math1 != null);
            formula = libsbml.formulaToString(math1);
            assertTrue(formula != null);
            assertTrue(("2 * k" == formula));
            assertTrue(EA.getMath() != math);
            assertEquals(true, EA.isSetMath());
            EA.setMath(EA.getMath());
            math1 = EA.getMath();
            assertTrue(math1 != null);
            formula = libsbml.formulaToString(math1);
            assertTrue(formula != null);
            assertTrue(("2 * k" == formula));
            assertTrue(EA.getMath() != math);
            EA.setMath(null);
            assertEquals(false, EA.isSetMath());
            if (EA.getMath() != null)
            {
                ;
            }
            {
            }
            math = null;
        }
        public void test_EventAssignment_setMath1()
        {
            ASTNode math = libsbml.parseFormula("2 * k");
            int     i    = E.setMath(math);

            assertTrue(i == libsbml.LIBSBML_OPERATION_SUCCESS);
            assertTrue(E.getMath() != math);
            assertEquals(true, E.isSetMath());
            i = E.setMath(null);
            assertTrue(i == libsbml.LIBSBML_OPERATION_SUCCESS);
            assertTrue(E.getMath() == null);
            assertEquals(false, E.isSetMath());
            math = null;
        }
Пример #3
0
    printEventAssignmentMath(int n, EventAssignment ea)
    {
        string variable;
        string formula;


        if (ea.isSetMath())
        {
            variable = ea.getVariable();
            formula  = libsbml.formulaToString(ea.getMath());

            Console.Write("  EventAssignment " + n
                          + ", trigger: " + variable + " = " + formula + Environment.NewLine);
        }
    }