Ignore:
Timestamp:
Aug 17, 2008, 7:47:10 PM (16 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #39
fixed Party_Ref

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/models/tests/test_reference_model.rb

    r97 r98  
    154154    assert_nothing_raised(Exception){@hier_object_id = OpenEHR::RM::Support::Identification::Hier_Object_ID.new('0.0.4')}
    155155    assert_nothing_raised(Exception){@locatable_ref = OpenEHR::RM::Support::Identification::Locatable_Ref.new('unknown', 'PERSON', @uid_based_id, 'data/event[at0001, standing]')}
     156    assert_nothing_raised(Exception){@party_ref = OpenEHR::RM::Support::Identification::Party_Ref.new('unknown', 'ORGANISATION', @object_id)}
    156157  end
    157158 
     
    166167    assert_instance_of OpenEHR::RM::Support::Identification::Hier_Object_ID, @hier_object_id
    167168    assert_instance_of OpenEHR::RM::Support::Identification::Locatable_Ref, @locatable_ref
     169    assert_instance_of OpenEHR::RM::Support::Identification::Party_Ref, @party_ref
    168170  end
    169171
     
    347349
    348350  def test_locatable_ref
    349 # test constructor function
     351# test constructorpp
    350352    assert_equal 'unknown', @locatable_ref.namespace
    351353    assert_equal 'PERSON', @locatable_ref.type
     
    358360    assert_equal 'ehr://rrip::0.0.3/data/event[at0002, tilting]', @locatable_ref.as_uri
    359361  end
     362
     363  def test_party_ref
     364# test constructor
     365    assert_equal 'unknown', @party_ref.namespace
     366    assert_equal 'ORGANISATION', @party_ref.type
     367    assert_equal @object_id, @party_ref.id
     368# test type validation
     369    assert_raise(ArgumentError){@party_ref.type = 'GUIDELINE'}
     370    assert_nothing_raised(Exception){@party_ref.type = 'PERSON'}
     371    assert_equal 'PERSON', @party_ref.type
     372    assert_nothing_raised(Exception){@party_ref.type = 'GROUP'}
     373    assert_nothing_raised(Exception){@party_ref.type = 'AGENT'}
     374    assert_nothing_raised(Exception){@party_ref.type = 'ROLE'}
     375    assert_nothing_raised(Exception){@party_ref.type = 'PARTY'}
     376    assert_nothing_raised(Exception){@party_ref.type = 'ACTOR'}
     377  end
    360378end
Note: See TracChangeset for help on using the changeset viewer.