Ignore:
Timestamp:
Sep 20, 2008, 12:09:11 PM (16 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #39, #65

File:
1 edited

Legend:

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

    r101 r102  
    407407  end
    408408end
     409
     410class RM_Common_Archetyped_Test < Test::Unit::TestCase
     411  def setup
     412    @dv_text = OpenEHR::RM::Data_Types::Text::DV_Text.new('Test')
     413    @uid_based_id = OpenEHR::RM::Support::Identification::UID_Based_ID.new('rrip::0.0.5')
     414    @archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")
     415    @template_id = OpenEHR::RM::Support::Identification::Template_ID.new('1.0.1')
     416    assert_nothing_raised(Exception){@archetyped = OpenEHR::RM::Common::Archetyped::Archetyped.new(@archetype_id, '1.0.1')}
     417   
     418  end
     419  def test_init
     420    assert_instance_of OpenEHR::RM::Common::Archetyped::Archetyped, @archetyped
     421  end
     422  def test_archetyped
     423    assert_equal @archetype_id, @archetyped.archetype_id
     424    assert_equal '1.0.1', @archetyped.rm_version
     425    assert_raise(ArgumentError){@archetyped.archetype_id = nil}
     426    assert_raise(ArgumentError){@archetyped.rm_version = nil}
     427    assert_raise(ArgumentError){@archetyped.rm_version = ''}
     428    assert_nothing_raised(Exception){@archetyped.template_id = @template_id}
     429    assert_equal @template_id, @archetyped.template_id
     430    archetype_id2 = OpenEHR::RM::Support::Identification::Archetype_ID.new("1.0.2", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3")
     431    assert_nothing_raised(ArgumentError){@archetyped.archetype_id = archetype_id2}
     432    assert_equal archetype_id2, @archetyped.archetype_id
     433    assert_nothing_raised(ArgumentError){@archetyped.rm_version = '1.0.2'}
     434    assert_equal '1.0.2', @archetyped.rm_version
     435  end
     436end
Note: See TracChangeset for help on using the changeset viewer.