public void test_AlgebraicRule() { AlgebraicRule ar = new AlgebraicRule(2, 4); assertEquals(false, (ar.hasRequiredElements())); ar.setMath(libsbml.parseFormula("ar")); assertEquals(true, ar.hasRequiredElements()); ar = null; }
public void test_AlgebraicRule_createWithMath() { ASTNode math = libsbml.parseFormula("1 + 1"); Rule ar = new AlgebraicRule(2, 4); ar.setMath(math); assertTrue(ar.getTypeCode() == libsbml.SBML_ALGEBRAIC_RULE); assertTrue(ar.getMetaId() == ""); assertTrue(("1 + 1" == ar.getFormula())); assertTrue(ar.getMath() != math); ar = null; }
public void test_Model_addRules() { Rule r1 = new AlgebraicRule(2, 4); Rule r2 = new AssignmentRule(2, 4); Rule r3 = new RateRule(2, 4); r2.setVariable("r2"); r3.setVariable("r3"); r1.setMath(libsbml.parseFormula("2")); r2.setMath(libsbml.parseFormula("2")); r3.setMath(libsbml.parseFormula("2")); M.addRule(r1); M.addRule(r2); M.addRule(r3); assertTrue(M.getNumRules() == 3); }