public void test_Reaction_addProduct1()
 {
     Reaction m = new  Reaction(2,2);
       SpeciesReference p = new  SpeciesReference(2,2);
       SpeciesReference p1 = new  SpeciesReference(2,2);
       p1.setSpecies( "k");
       p1.setId( "k1");
       int i = m.addProduct(p);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       p.setSpecies( "k");
       p.setId( "k1");
       i = m.addProduct(p);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumProducts() == 1 );
       i = m.addProduct(p1);
       assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID );
       assertTrue( m.getNumProducts() == 1 );
       p = null;
       p1 = null;
       m = null;
 }
 public void test_internal_consistency_check_99920()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       SpeciesReference sr = new SpeciesReference(2,4);
       d.setLevelAndVersion(1,2,false);
       Model m = d.createModel();
       Compartment c = m.createCompartment();
       c.setId("c");
       Species s = m.createSpecies();
       s.setId("s");
       Reaction r = m.createReaction();
       r.setId("r");
       s.setCompartment("c");
       sr.setSpecies("s");
       sr.setId("mmm");
       r.addProduct(sr);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
예제 #3
0
 public void test_SpeciesReference_copyConstructor()
 {
     SpeciesReference o1 = new SpeciesReference(2,4);
       o1.setId("c");
       assertTrue( o1.getId() ==  "c" );
       SpeciesReference o2 = new SpeciesReference(o1);
       assertTrue( o2.getId() ==  "c" );
       assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() );
       o2 = null;
       o1 = null;
 }
예제 #4
0
 public void test_SpeciesReference_assignmentOperator()
 {
     SpeciesReference o1 = new SpeciesReference(2,4);
       o1.setId("c");
       assertTrue( o1.getId() ==  "c" );
       SpeciesReference o2 = new SpeciesReference(2,4);
       o2 = o1;
       assertTrue( o2.getId() ==  "c" );
       assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() );
       o2 = null;
       o1 = null;
 }
 public void test_SpeciesReference_setId3()
 {
     SpeciesReference c = new  SpeciesReference(2,1);
       int i = c.setId( "cell");
       c = null;
 }
예제 #6
0
 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.");
 }