public void test_StoichiometryMath_parent_add() { StoichiometryMath m = new StoichiometryMath(2,4); SpeciesReference sr = new SpeciesReference(2,4); sr.setStoichiometryMath(m); m = null; assertTrue( sr == sr.getStoichiometryMath().getParentSBMLObject() ); sr = null; }
public void TestStoichiometryMath() { SpeciesReference sr = new SpeciesReference(2,3); sr.setId("S0"); sr.setStoichiometry(0); sr.setStoichiometryMath(new StoichiometryMath(2, 3)); string math = SbmlFunctions.GetStoichiometryMath(sr); Assert.AreEqual(null, math, "GetStoichiometryMath returns unexpected value."); }
public void test_SpeciesReference_setStoichiometryMath5() { SpeciesReference sr1 = new SpeciesReference(1,2); StoichiometryMath sm = new StoichiometryMath(2,4); ASTNode math = new ASTNode(libsbml.AST_TIMES); ASTNode a = new ASTNode(); ASTNode b = new ASTNode(); a.setName( "a"); b.setName( "b"); math.addChild(a); math.addChild(b); sm.setMath(math); int i = sr1.setStoichiometryMath(sm); assertTrue( i == libsbml.LIBSBML_UNEXPECTED_ATTRIBUTE ); assertEquals( false, sr1.isSetStoichiometryMath() ); sm = null; sr1 = null; }
public void test_StoichiometryMath_ancestor_add() { StoichiometryMath m = new StoichiometryMath(2,4); SpeciesReference sr = new SpeciesReference(2,4); sr.setStoichiometryMath(m); m = null; StoichiometryMath obj = sr.getStoichiometryMath(); assertTrue( obj.getAncestorOfType(libsbml.SBML_SPECIES_REFERENCE) == sr ); assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == null ); assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null ); sr = null; }