當前位置: 首頁>>代碼示例>>C#>>正文


C# UnitDefinition.getNumUnits方法代碼示例

本文整理匯總了C#中libsbmlcs.UnitDefinition.getNumUnits方法的典型用法代碼示例。如果您正苦於以下問題:C# UnitDefinition.getNumUnits方法的具體用法?C# UnitDefinition.getNumUnits怎麽用?C# UnitDefinition.getNumUnits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在libsbmlcs.UnitDefinition的用法示例。


在下文中一共展示了UnitDefinition.getNumUnits方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: test_UnitDefinition_addUnit2

 public void test_UnitDefinition_addUnit2()
 {
     UnitDefinition m = new  UnitDefinition(2,2);
       Unit p = new  Unit(2,1);
       p.setKind(libsbml.UNIT_KIND_MOLE);
       int i = m.addUnit(p);
       assertTrue( i == libsbml.LIBSBML_VERSION_MISMATCH );
       assertTrue( m.getNumUnits() == 0 );
       p = null;
       m = null;
 }
開發者ID:0u812,項目名稱:roadrunner-backup,代碼行數:11,代碼來源:TestUnitDefinition_newSetters.cs

示例2: test_UnitDefinition_addUnit1

 public void test_UnitDefinition_addUnit1()
 {
     UnitDefinition m = new  UnitDefinition(2,2);
       Unit p = new  Unit(2,2);
       int i = m.addUnit(p);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       p.setKind(libsbml.UNIT_KIND_MOLE);
       i = m.addUnit(p);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( m.getNumUnits() == 1 );
       p = null;
       m = null;
 }
開發者ID:0u812,項目名稱:roadrunner-backup,代碼行數:13,代碼來源:TestUnitDefinition_newSetters.cs

示例3: test_UnitDefinition_createWithName

 public void test_UnitDefinition_createWithName()
 {
     UnitDefinition ud = new  UnitDefinition(2,4);
       ud.setName( "mmol_per_liter_per_sec");
       assertTrue( ud.getTypeCode() == libsbml.SBML_UNIT_DEFINITION );
       assertTrue( ud.getMetaId() == "" );
       assertTrue( ud.getNotes() == null );
       assertTrue( ud.getAnnotation() == null );
       assertTrue( ud.getId() == "" );
       assertTrue((  "mmol_per_liter_per_sec" == ud.getName() ));
       assertEquals( true, ud.isSetName() );
       assertTrue( ud.getNumUnits() == 0 );
       ud = null;
 }
開發者ID:alexholehouse,項目名稱:SBMLIntegrator,代碼行數:14,代碼來源:TestUnitDefinition.cs

示例4: test_Unit_parent_create

 public void test_Unit_parent_create()
 {
     UnitDefinition ud = new UnitDefinition(2,4);
       Unit u = ud.createUnit();
       assertTrue( ud.getNumUnits() == 1 );
       ListOf lo = ud.getListOfUnits();
       assertTrue( lo == ud.getUnit(0).getParentSBMLObject() );
       assertTrue( lo == u.getParentSBMLObject() );
       assertTrue( ud == lo.getParentSBMLObject() );
       ud = null;
 }
開發者ID:alexholehouse,項目名稱:SBMLIntegrator,代碼行數:11,代碼來源:TestSBMLParentObject.cs

示例5: test_Unit_parent_add

 public void test_Unit_parent_add()
 {
     UnitDefinition ud = new UnitDefinition(2,4);
       Unit u = new Unit(2,4);
       u.setKind(libsbml.UNIT_KIND_MOLE);
       ud.addUnit(u);
       u = null;
       assertTrue( ud.getNumUnits() == 1 );
       ListOf lo = ud.getListOfUnits();
       assertTrue( lo == ud.getUnit(0).getParentSBMLObject() );
       assertTrue( ud == lo.getParentSBMLObject() );
       ud = null;
 }
開發者ID:alexholehouse,項目名稱:SBMLIntegrator,代碼行數:13,代碼來源:TestSBMLParentObject.cs

示例6: test_Unit_ancestor_create

 public void test_Unit_ancestor_create()
 {
     UnitDefinition ud = new UnitDefinition(2,4);
       Unit u = ud.createUnit();
       assertTrue( ud.getNumUnits() == 1 );
       ListOf lo = ud.getListOfUnits();
       assertTrue( u.getAncestorOfType(libsbml.SBML_UNIT_DEFINITION) == ud );
       assertTrue( u.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( u.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( u.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
       Unit obj = ud.getUnit(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_UNIT_DEFINITION) == ud );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
       ud = null;
 }
開發者ID:alexholehouse,項目名稱:SBMLIntegrator,代碼行數:17,代碼來源:TestAncestor.cs

示例7: test_Unit_ancestor_add

 public void test_Unit_ancestor_add()
 {
     UnitDefinition ud = new UnitDefinition(2,4);
       Unit u = new Unit(2,4);
       u.setKind(libsbml.UNIT_KIND_MOLE);
       ud.addUnit(u);
       u = null;
       assertTrue( ud.getNumUnits() == 1 );
       ListOf lo = ud.getListOfUnits();
       Unit obj = ud.getUnit(0);
       assertTrue( obj.getAncestorOfType(libsbml.SBML_UNIT_DEFINITION) == ud );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_LIST_OF) == lo );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_DOCUMENT) == null );
       assertTrue( obj.getAncestorOfType(libsbml.SBML_COMPARTMENT) == null );
       ud = null;
 }
開發者ID:alexholehouse,項目名稱:SBMLIntegrator,代碼行數:16,代碼來源:TestAncestor.cs

示例8: test_UnitDefinition_addUnit4

 public void test_UnitDefinition_addUnit4()
 {
     UnitDefinition m = new  UnitDefinition(2,2);
       Unit p = null;
       int i = m.addUnit(p);
       assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
       assertTrue( m.getNumUnits() == 0 );
       m = null;
 }
開發者ID:0u812,項目名稱:roadrunner-backup,代碼行數:9,代碼來源:TestUnitDefinition_newSetters.cs

示例9: test_UnitDefinition_createUnit

 public void test_UnitDefinition_createUnit()
 {
     UnitDefinition m = new  UnitDefinition(2,2);
       Unit p = m.createUnit();
       assertTrue( m.getNumUnits() == 1 );
       assertTrue( (p).getLevel() == 2 );
       assertTrue( (p).getVersion() == 2 );
       m = null;
 }
開發者ID:0u812,項目名稱:roadrunner-backup,代碼行數:9,代碼來源:TestUnitDefinition_newSetters.cs


注:本文中的libsbmlcs.UnitDefinition.getNumUnits方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。