Пример #1
0
 public void test_AssignmentRule_createWithFormula()
 {
     ASTNode math;
       string formula;
       Rule ar = new  AssignmentRule(2,4);
       ar.setVariable( "s");
       ar.setFormula( "1 + 1");
       assertTrue( ar.getTypeCode() == libsbml.SBML_ASSIGNMENT_RULE );
       assertTrue( ar.getMetaId() == "" );
       assertTrue((  "s" == ar.getVariable() ));
       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_AssignmentRule_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(2,1);
       sbmlns.addNamespaces(xmlns);
       Rule object1 = new  AssignmentRule(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_ASSIGNMENT_RULE );
       assertTrue( object1.getMetaId() == "" );
       assertTrue( object1.getNotes() == null );
       assertTrue( object1.getAnnotation() == null );
       assertTrue( object1.getLevel() == 2 );
       assertTrue( object1.getVersion() == 1 );
       assertTrue( object1.getNamespaces() != null );
       assertTrue( object1.getNamespaces().getLength() == 2 );
       object1 = null;
 }
Пример #3
0
 public void test_AssignmentRule_createWithMath()
 {
     ASTNode math = libsbml.parseFormula("1 + 1");
       Rule ar = new  AssignmentRule(2,4);
       ar.setVariable( "s");
       ar.setMath(math);
       assertTrue( ar.getTypeCode() == libsbml.SBML_ASSIGNMENT_RULE );
       assertTrue( ar.getMetaId() == "" );
       assertTrue((  "s" == ar.getVariable() ));
       assertTrue((  "1 + 1" == ar.getFormula() ));
       assertTrue( ar.getMath() != math );
       ar = null;
 }