setId() public method

public setId ( string sid ) : int
sid string
return int
コード例 #1
0
 public void test_Model_addSpeciesType4()
 {
     Model m = new  Model(2,2);
       SpeciesType st = new  SpeciesType(2,2);
       st.setId( "st");
       SpeciesType st1 = new  SpeciesType(2,2);
       st1.setId( "st");
       int i = m.addSpeciesType(st);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumSpeciesTypes() == 1 );
       i = m.addSpeciesType(st1);
       assertTrue( i == libsbml.LIBSBML_DUPLICATE_OBJECT_ID );
       assertTrue( m.getNumSpeciesTypes() == 1 );
       st = null;
       st1 = null;
       m = null;
 }
コード例 #2
0
 public void test_internal_consistency_check_99905_st()
 {
     SBMLDocument d = new SBMLDocument(2,4);
       long errors;
       SpeciesType ct = new SpeciesType(2,4);
       Model m = d.createModel();
       d.setLevelAndVersion(2,2,false);
       ct.setId("st");
       ct.setSBOTerm(5);
       m.addSpeciesType(ct);
       errors = d.checkInternalConsistency();
       assertTrue( errors == 0 );
       d = null;
 }
コード例 #3
0
 public void test_Model_addSpeciesType2()
 {
     Model m = new  Model(2,2);
       SpeciesType st = new  SpeciesType(2,3);
       st.setId( "st");
       int i = m.addSpeciesType(st);
       assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
       assertTrue( m.getNumSpeciesTypes() == 0 );
       st = null;
       m = null;
 }
コード例 #4
0
 public void test_SpeciesType_copyConstructor()
 {
     SpeciesType o1 = new SpeciesType(2,4);
       o1.setId("c");
       assertTrue( o1.getId() ==  "c" );
       SpeciesType o2 = new SpeciesType(o1);
       assertTrue( o2.getId() ==  "c" );
       assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() );
       o2 = null;
       o1 = null;
 }
コード例 #5
0
 public void test_SpeciesType_assignmentOperator()
 {
     SpeciesType o1 = new SpeciesType(2,4);
       o1.setId("c");
       assertTrue( o1.getId() ==  "c" );
       SpeciesType o2 = new SpeciesType(2,4);
       o2 = o1;
       assertTrue( o2.getId() ==  "c" );
       assertTrue( o2.getParentSBMLObject() == o1.getParentSBMLObject() );
       o2 = null;
       o1 = null;
 }
コード例 #6
0
 public void test_SpeciesType_parent_add()
 {
     SpeciesType ia = new SpeciesType(2,4);
       ia.setId("s");
       Model m = new Model(2,4);
       m.addSpeciesType(ia);
       ia = null;
       ListOf lo = m.getListOfSpeciesTypes();
       assertTrue( lo == m.getSpeciesType(0).getParentSBMLObject() );
       assertTrue( m == lo.getParentSBMLObject() );
 }
コード例 #7
0
 public void test_SpeciesType()
 {
     SpeciesType st = new SpeciesType(2,4);
       assertEquals( false, (st.hasRequiredAttributes()) );
       st.setId("st");
       assertEquals( true, st.hasRequiredAttributes() );
       st = null;
 }
コード例 #8
0
ファイル: TestAncestor.cs プロジェクト: mgaldzic/copasi_api
 public void test_SpeciesType_ancestor_add()
 {
     SpeciesType ia = new SpeciesType(2,4);
       Model m = new Model(2,4);
       ia.setId("s");
       m.addSpeciesType(ia);
       ia = null;
       ListOf lo = m.getListOfSpeciesTypes();
       SpeciesType obj = m.getSpeciesType(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_MODEL) == m );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_EVENT) == null );
 }