public void test_Compartment_setUnits1() { int i = C.setUnits("1cell"); assertTrue(i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE); assertEquals(false, C.isSetUnits()); i = C.unsetUnits(); assertTrue(i == libsbml.LIBSBML_OPERATION_SUCCESS); assertEquals(false, C.isSetUnits()); }
public void test_Compartment_setUnits() { string units = "volume"; C.setUnits(units); assertTrue((units == C.getUnits())); assertEquals(true, C.isSetUnits()); if (C.getUnits() == units) { ; } { } C.setUnits(C.getUnits()); assertTrue((units == C.getUnits())); C.setUnits(""); assertEquals(false, C.isSetUnits()); if (C.getUnits() != null) { ; } { } }
public void test_SBMLConvert_invalidLevelVersion() { SBMLDocument d = new SBMLDocument(2, 1); Model m = d.createModel(); string sid = "C"; Compartment c = m.createCompartment(); c.setId(sid); c.setSize(1.2); c.setUnits("volume"); assertTrue(d.setLevelAndVersion(1, 3, true) == false); assertTrue(d.setLevelAndVersion(2, 7, true) == false); assertTrue(d.setLevelAndVersion(3, 5, true) == false); assertTrue(d.setLevelAndVersion(4, 1, true) == false); }
public void test_SBMLConvert_convertToL3_defaultUnits() { SBMLDocument d = new SBMLDocument(1, 2); Model m = d.createModel(); string sid = "C"; Compartment c = m.createCompartment(); c.setId(sid); c.setSize(1.2); c.setUnits("volume"); assertTrue(m.getNumUnitDefinitions() == 0); assertTrue(d.setLevelAndVersion(3, 1, true) == true); assertTrue(m.getNumUnitDefinitions() == 2); UnitDefinition ud = m.getUnitDefinition(0); assertTrue(ud != null); assertTrue(("volume" == ud.getId())); assertTrue(ud.getNumUnits() == 1); Unit u = ud.getUnit(0); assertTrue(u.getKind() == libsbml.UNIT_KIND_LITRE); assertTrue(u.getExponent() == 1); assertTrue(u.getMultiplier() == 1); assertTrue(u.getScale() == 0); ud = m.getUnitDefinition(1); assertTrue(ud != null); assertTrue(("area" == ud.getId())); assertTrue(ud.getNumUnits() == 1); u = ud.getUnit(0); assertTrue(u.getKind() == libsbml.UNIT_KIND_METRE); assertTrue(u.getExponent() == 2); assertTrue(u.getMultiplier() == 1); assertTrue(u.getScale() == 0); assertTrue(("second" == m.getTimeUnits())); d = null; }