END_TEST START_TEST (test_WriteL3SBML_Reaction_compartment) { const char* expected = "<reaction id=\"r\" reversible=\"false\"" " fast=\"true\" compartment=\"c\"/>"; const char* expected1 = "<reaction id=\"r\" reversible=\"false\"" " fast=\"true\"/>"; Reaction *r = D->createModel()->createReaction(); r->setId("r"); r->setReversible(false); r->setFast(true); r->setCompartment("c"); char* sbml = r->toSBML(); fail_unless( equals(expected, sbml) ); safe_free(sbml); r->unsetCompartment(); sbml = r->toSBML(); fail_unless( equals(expected1, sbml) ); safe_free(sbml); }
END_TEST START_TEST (test_WriteL3SBML_Reaction_full) { const char* expected = "<reaction id=\"v1\" reversible=\"true\" fast=\"false\">\n" " <listOfReactants>\n" " <speciesReference species=\"x0\"/>\n" " </listOfReactants>\n" " <listOfProducts>\n" " <speciesReference species=\"s1\"/>\n" " </listOfProducts>\n" " <listOfModifiers>\n" " <modifierSpeciesReference species=\"m1\"/>\n" " </listOfModifiers>\n" " <kineticLaw>\n" " <math xmlns=\"http://www.w3.org/1998/Math/MathML\">\n" " <apply>\n" " <divide/>\n" " <apply>\n" " <times/>\n" " <ci> vm </ci>\n" " <ci> s1 </ci>\n" " </apply>\n" " <apply>\n" " <plus/>\n" " <ci> km </ci>\n" " <ci> s1 </ci>\n" " </apply>\n" " </apply>\n" " </math>\n" " </kineticLaw>\n" "</reaction>"; D->createModel(); Reaction* r = D->getModel()->createReaction(); r->setId("v1"); r->setReversible(true); r->setFast(false); r->createReactant()->setSpecies("x0"); r->createProduct ()->setSpecies("s1"); r->createModifier()->setSpecies("m1"); r->createKineticLaw()->setFormula("(vm * s1)/(km + s1)"); char* sbml = r->toSBML(); fail_unless( equals(expected, sbml) ); safe_free(sbml); }