Example #1
0
 public void setUp()
 {
     P = new  Priority(3,1);
       if (P == null);
       {
       }
 }
Example #2
0
 public void test_Priority_createWithNS()
 {
     XMLNamespaces xmlns = new  XMLNamespaces();
       xmlns.add( "http://www.sbml.org", "testsbml");
       SBMLNamespaces sbmlns = new  SBMLNamespaces(3,1);
       sbmlns.addNamespaces(xmlns);
       Priority object1 = new  Priority(sbmlns);
       assertTrue( object1.getTypeCode() == libsbml.SBML_PRIORITY );
       assertTrue( object1.getMetaId() == "" );
       assertTrue( object1.getNotes() == null );
       assertTrue( object1.getAnnotation() == null );
       assertTrue( object1.getLevel() == 3 );
       assertTrue( object1.getVersion() == 1 );
       assertTrue( object1.getNamespaces() != null );
       assertTrue( object1.getNamespaces().getLength() == 2 );
       object1 = null;
 }
        public void test_Priority_constructor()
        {
            SBase s;

              try
              {
            s = new Priority(3,1);
            s = new Priority(SN31);
              }
              catch (SBMLConstructorException e)
              {
             s = null;
              }
              assertTrue(s != null);

              string msg = "";

              try
              {
            s = new Priority(9,9);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";

              try
              {
            s = new Priority(SN21);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);

              msg = "";

              try
              {
            s = new Priority(SN99);
              }
              catch (SBMLConstructorException e)
              {
             msg = e.Message;
              }
              assertTrue(msg == ErrMsg);
        }
Example #4
0
 /**
    * (SBML Level 3 only) Sets the priority definition of this Event
    * to a copy of the given Priority object instance.
    *
    * @param priority the Priority object instance to use
    *
    * @return integer value indicating success/failure of the
    * function.  @if clike The value is drawn from the
    * enumeration #OperationReturnValues_t. @endif The possible values
    * returned by this function are:
    * @li @link libsbmlcs#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS@endlink
    * @li @link libsbmlcs#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH@endlink
    * @li @link libsbmlcs#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH@endlink
    * @li @link libsbmlcs#LIBSBML_UNEXPECTED_ATTRIBUTE LIBSBML_UNEXPECTED_ATTRIBUTE@endlink
    *
    * @note The element 'priority' is available in SBML Level 3
    * Version 1 Core, but is not present in lower Levels of SBML.
    */
 public int setPriority(Priority priority)
 {
     int ret = libsbmlPINVOKE.Event_setPriority(swigCPtr, Priority.getCPtr(priority));
     return ret;
 }
Example #5
0
        internal static HandleRef getCPtrAndDisown(Priority obj)
        {
            HandleRef ptr = new HandleRef(null, IntPtr.Zero);

            if (obj != null)
            {
            ptr             = obj.swigCPtr;
            obj.swigCMemOwn = false;
            }

            return ptr;
        }
Example #6
0
 internal static HandleRef getCPtr(Priority obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Example #7
0
 /**
    * Copy constructor; creates a copy of this Priority.
    */
 public Priority(Priority orig)
     : this(libsbmlPINVOKE.new_Priority__SWIG_2(Priority.getCPtr(orig)), true)
 {
     if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
 }
 public void test_L3_Event_setPriority1()
 {
     Priority priority = new  Priority(3,1);
       ASTNode math1 = libsbml.parseFormula("0");
       priority.setMath(math1);
       assertEquals( false, E.isSetPriority() );
       int i = E.setPriority(priority);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( true, E.isSetPriority() );
       i = E.unsetPriority();
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertEquals( false, E.isSetPriority() );
       priority = null;
 }
Example #9
0
 public void tearDown()
 {
     P = null;
 }
 internal static HandleRef getCPtr(Priority obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }