Пример #1
0
 public void test_AlgebraicRule_createWithFormula()
 {
     ASTNode math;
       string formula;
       Rule ar = new  AlgebraicRule(2,4);
       ar.setFormula( "1 + 1");
       assertTrue( ar.getTypeCode() == libsbml.SBML_ALGEBRAIC_RULE );
       assertTrue( ar.getMetaId() == "" );
       math = ar.getMath();
       assertTrue( math != null );
       formula = libsbml.formulaToString(math);
       assertTrue( formula != null );
       assertTrue((  "1 + 1" == formula ));
       assertTrue(( formula == ar.getFormula() ));
       ar = null;
 }
Пример #2
0
 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;
 }
Пример #3
0
 public void test_AlgebraicRule_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,3);
       sbmlns.addNamespaces(xmlns);
       Rule r = new  AlgebraicRule(sbmlns);
       assertTrue( r.getTypeCode() == libsbml.SBML_ALGEBRAIC_RULE );
       assertTrue( r.getMetaId() == "" );
       assertTrue( r.getNotes() == null );
       assertTrue( r.getAnnotation() == null );
       assertTrue( r.getLevel() == 2 );
       assertTrue( r.getVersion() == 3 );
       assertTrue( r.getNamespaces() != null );
       assertTrue( r.getNamespaces().getLength() == 2 );
       r = null;
 }