Changeset 96


Ignore:
Timestamp:
Jul 30, 2008, 10:13:06 PM (16 years ago)
Author:
KOBAYASHI, Shinji
Message:

Make test cases

File:
1 edited

Legend:

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

    r95 r96  
    153153    assert_nothing_raised(Exception){@uid_based_id = OpenEHR::RM::Support::Identification::UID_Based_ID.new('rrip::0.0.3')}
    154154    assert_nothing_raised(Exception){@hier_object_id = OpenEHR::RM::Support::Identification::Hier_Object_ID.new('0.0.4')}
     155    assert_nothing_raised(Exception){@locatable_ref = OpenEHR::RM::Support::Identification::Locatable_Ref.new('unknown', 'PERSON', @uid_based_id, '/data/event[at0001, standing]')}
    155156  end
    156157 
     
    161162    assert_instance_of OpenEHR::RM::Support::Identification::Terminology_ID, @terminology_id
    162163    assert_instance_of OpenEHR::RM::Support::Identification::Object_ID, @object_id
     164    assert_instance_of OpenEHR::RM::Support::Identification::Generic_ID, @generic_id
    163165    assert_instance_of OpenEHR::RM::Support::Identification::UID_Based_ID, @uid_based_id
    164166    assert_instance_of OpenEHR::RM::Support::Identification::Hier_Object_ID, @hier_object_id
     167    assert_instance_of OpenEHR::RM::Support::Identification::Locatable_Ref, @locatable_ref
    165168  end
    166169
     
    174177    assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new(nil)}
    175178    assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new("")}
     179    assert_equal @object_id, OpenEHR::RM::Support::Identification::Object_ID.new("0.0.4")
    176180  end
    177181
     
    341345    assert !@hier_object_id.extension.empty?
    342346  end
     347
     348  def test_locatable_ref
     349# test constructor function
     350    assert_equal 'unknown', @locatable_ref.namespace
     351    assert_equal 'PARTY', @locatable_ref.type
     352    assert_equal @uid_based_id, @locatable_ref.id
     353    assert_equal '/data/event[at0001, standing]', @locatable_ref.path
     354    assert_equal 'ehr://rrip/data/event[at0001, standing]', @locatable_ref.as_uri
     355
     356
     357  end
    343358end
Note: See TracChangeset for help on using the changeset viewer.