public void test_Unit_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(2,1); sbmlns.addNamespaces(xmlns); Unit object1 = new Unit(sbmlns); assertTrue( object1.getTypeCode() == libsbml.SBML_UNIT ); assertTrue( object1.getMetaId() == "" ); assertTrue( object1.getNotes() == null ); assertTrue( object1.getAnnotation() == null ); assertTrue( object1.getLevel() == 2 ); assertTrue( object1.getVersion() == 1 ); assertTrue( object1.getNamespaces() != null ); assertTrue( object1.getNamespaces().getLength() == 2 ); object1 = null; }
public void test_L3_Unit_createWithNS() { XMLNamespaces xmlns = new XMLNamespaces(); xmlns.add( "http://www.sbml.org", "testsbml"); SBMLNamespaces sbmlns = new SBMLNamespaces(3,1); sbmlns.addNamespaces(xmlns); Unit u = new Unit(sbmlns); assertTrue( u.getTypeCode() == libsbml.SBML_UNIT ); assertTrue( u.getMetaId() == "" ); assertTrue( u.getNotes() == null ); assertTrue( u.getAnnotation() == null ); assertTrue( u.getLevel() == 3 ); assertTrue( u.getVersion() == 1 ); assertTrue( u.getNamespaces() != null ); assertTrue( u.getNamespaces().getLength() == 2 ); assertTrue( u.getKind() == libsbml.UNIT_KIND_INVALID ); assertEquals( true, isnan(u.getExponentAsDouble()) ); assertEquals( true, isnan(u.getMultiplier()) ); assertEquals( false, u.isSetKind() ); assertEquals( false, u.isSetExponent() ); assertEquals( false, u.isSetMultiplier() ); assertEquals( false, u.isSetScale() ); u = null; }