1# @file TestCompartmentType_newSetters.rb 2# @brief CompartmentType unit tests for new set function API 3# 4# @author Akiya Jouraku (Ruby conversion) 5# @author Sarah Keating 6# 7# 8# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ====== 9# 10# DO NOT EDIT THIS FILE. 11# 12# This file was generated automatically by converting the file located at 13# src/sbml/test/TestCompartmentType_newSetters.c 14# using the conversion program dev/utilities/translateTests/translateTests.pl. 15# Any changes made here will be lost the next time the file is regenerated. 16# 17# ----------------------------------------------------------------------------- 18# This file is part of libSBML. Please visit http://sbml.org for more 19# information about SBML, and the latest version of libSBML. 20# 21# Copyright 2005-2010 California Institute of Technology. 22# Copyright 2002-2005 California Institute of Technology and 23# Japan Science and Technology Corporation. 24# 25# This library is free software; you can redistribute it and/or modify it 26# under the terms of the GNU Lesser General Public License as published by 27# the Free Software Foundation. A copy of the license agreement is provided 28# in the file named "LICENSE.txt" included with this software distribution 29# and also available online as http://sbml.org/software/libsbml/license.html 30# ----------------------------------------------------------------------------- 31require 'test/unit' 32require 'libSBML' 33 34class TestCompartmentType_newSetters < Test::Unit::TestCase 35 36 def setup 37 @@c = LibSBML::CompartmentType.new(2,2) 38 if (@@c == nil) 39 end 40 end 41 42 def teardown 43 @@c = nil 44 end 45 46 def test_CompartmentType_setId2 47 i = @@c.setId( "1cell") 48 assert( i == LibSBML::LIBSBML_INVALID_ATTRIBUTE_VALUE ) 49 assert_equal false, @@c.isSetId() 50 end 51 52 def test_CompartmentType_setId3 53 i = @@c.setId( "cell") 54 assert( i == LibSBML::LIBSBML_OPERATION_SUCCESS ) 55 assert_equal true, @@c.isSetId() 56 assert (( "cell" == @@c.getId() )) 57 end 58 59 def test_CompartmentType_setId4 60 i = @@c.setId("") 61 assert( i == LibSBML::LIBSBML_OPERATION_SUCCESS ) 62 assert_equal false, @@c.isSetId() 63 end 64 65 def test_CompartmentType_setName1 66 i = @@c.setName( "cell") 67 assert( i == LibSBML::LIBSBML_OPERATION_SUCCESS ) 68 assert_equal true, @@c.isSetName() 69 i = @@c.unsetName() 70 assert( i == LibSBML::LIBSBML_OPERATION_SUCCESS ) 71 assert_equal false, @@c.isSetName() 72 end 73 74 def test_CompartmentType_setName2 75 i = @@c.setName( "1cell") 76 assert( i == LibSBML::LIBSBML_OPERATION_SUCCESS ) 77 assert_equal true, @@c.isSetName() 78 i = @@c.unsetName() 79 assert( i == LibSBML::LIBSBML_OPERATION_SUCCESS ) 80 assert_equal false, @@c.isSetName() 81 end 82 83 def test_CompartmentType_setName3 84 i = @@c.setName("") 85 assert( i == LibSBML::LIBSBML_OPERATION_SUCCESS ) 86 assert_equal false, @@c.isSetName() 87 end 88 89end 90 91