setVolume() public method

public setVolume ( double value ) : int
value double
return int
 public void test_Compartment_setVolume2()
 {
     Compartment c = new  Compartment(2,2);
       int i = c.setVolume(4);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( c.getVolume() == 4.0 );
       assertEquals( true, c.isSetVolume() );
       i = c.unsetVolume();
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( false, c.isSetVolume() );
       c = null;
 }
Exemplo n.º 2
0
        public void TestGetCompartmentVolume()
        {
            Compartment c = new Compartment(2, 3);
            double value;
            value = SbmlFunctions.GetCompartmentVolume(c);
            Assert.AreEqual(double.NaN, value, "GetCompartmentVolume returns unexpected value.");

            c.setVolume(2.0);
            value = SbmlFunctions.GetCompartmentVolume(c);
            Assert.AreEqual(2.0, value, "GetCompartmentVolume returns unexpected value.");
        }