当前位置: 首页>>代码示例>>C#>>正文


C# UnitDefinition.addUnit方法代码示例

本文整理汇总了C#中libsbmlcs.UnitDefinition.addUnit方法的典型用法代码示例。如果您正苦于以下问题:C# UnitDefinition.addUnit方法的具体用法?C# UnitDefinition.addUnit怎么用?C# UnitDefinition.addUnit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在libsbmlcs.UnitDefinition的用法示例。


在下文中一共展示了UnitDefinition.addUnit方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: 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

示例3: test_UnitDefinition_isVariantOfSubstancePerTime_4

 public void test_UnitDefinition_isVariantOfSubstancePerTime_4()
 {
     UnitDefinition ud = new  UnitDefinition(2,2);
       Unit dim = ud.createUnit();
       dim.setKind(libsbml.UnitKind_forName("dimensionless"));
       Unit perTime = ud.createUnit();
       perTime.setKind(libsbml.UnitKind_forName("second"));
       perTime.setExponent(-1);
       Unit u = ud.createUnit();
       assertEquals( false, ud.isVariantOfSubstancePerTime() );
       u.setKind(libsbml.UNIT_KIND_KILOGRAM);
       u.setExponent(1);
       assertEquals( true, ud.isVariantOfSubstancePerTime() );
       u.setScale(-1);
       perTime.setScale(-1);
       assertEquals( true, ud.isVariantOfSubstancePerTime() );
       u.setMultiplier(2);
       assertEquals( true, ud.isVariantOfSubstancePerTime() );
       u.setOffset(3);
       assertEquals( true, ud.isVariantOfSubstancePerTime() );
       u.setExponent(-3);
       assertEquals( false, ud.isVariantOfSubstancePerTime() );
       u.setExponent(1);
       perTime.setExponent(-3);
       assertEquals( false, ud.isVariantOfSubstancePerTime() );
       perTime.setExponent(-1);
       ud.addUnit(dim);
       assertEquals( true, ud.isVariantOfSubstancePerTime() );
       ud = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:30,代码来源:TestUnitDefinition.cs

示例4: 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

示例5: 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

示例6: 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

示例7: test_SBMLDocument_setLevelAndVersion_Error

 public void test_SBMLDocument_setLevelAndVersion_Error()
 {
     SBMLDocument d = new  SBMLDocument();
       d.setLevelAndVersion(2,1,true);
       Model m1 = new  Model(2,1);
       Unit u = new  Unit(2,1);
       u.setKind(libsbml.UnitKind_forName("mole"));
       u.setOffset(3.2);
       UnitDefinition ud = new  UnitDefinition(2,1);
       ud.setId( "ud");
       ud.addUnit(u);
       m1.addUnitDefinition(ud);
       d.setModel(m1);
       assertTrue( d.setLevelAndVersion(2,2,true) == false );
       assertTrue( d.setLevelAndVersion(2,3,true) == false );
       assertTrue( d.setLevelAndVersion(1,2,true) == false );
       assertTrue( d.setLevelAndVersion(1,1,true) == false );
       d = null;
 }
开发者ID:alexholehouse,项目名称:SBMLIntegrator,代码行数:19,代码来源:TestSBMLDocument.cs


注:本文中的libsbmlcs.UnitDefinition.addUnit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。