public void test_FunctionDefinition_createWith() { ASTNode math = libsbml.parseFormula("lambda(x, x^3)"); FunctionDefinition fd = new FunctionDefinition(2,4); fd.setId( "pow3"); fd.setMath(math); ASTNode math1; string formula; assertTrue( fd.getTypeCode() == libsbml.SBML_FUNCTION_DEFINITION ); assertTrue( fd.getMetaId() == "" ); assertTrue( fd.getNotes() == null ); assertTrue( fd.getAnnotation() == null ); assertTrue( fd.getName() == "" ); math1 = fd.getMath(); assertTrue( math1 != null ); formula = libsbml.formulaToString(math1); assertTrue( formula != null ); assertTrue(( "lambda(x, x^3)" == formula )); assertTrue( fd.getMath() != math ); assertEquals( true, fd.isSetMath() ); assertTrue(( "pow3" == fd.getId() )); assertEquals( true, fd.isSetId() ); math = null; fd = null; }
public void test_FunctionDefinition_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(2,1); sbmlns.addNamespaces(xmlns); FunctionDefinition object1 = new FunctionDefinition(sbmlns); assertTrue( object1.getTypeCode() == libsbml.SBML_FUNCTION_DEFINITION ); 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; }