Changeset 156 for ruby/trunk/lib/models/tests/rm/test_common.rb
- Timestamp:
- Jul 4, 2009, 7:39:20 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/lib/models/tests/rm/test_common.rb
r155 r156 9 9 include OpenEHR::RM::Support::Identification 10 10 include OpenEHR::RM::Data_Types::Basic 11 include OpenEHR::RM::Data_Types::Quantity 11 12 12 13 class RM_Common_Resource_Test < Test::Unit::TestCase … … 142 143 assert_raise(ArgumentError){ 143 144 party_identified = Party_Identified.new} 145 144 146 identifiers = [] 145 147 identifiers << DV_Identifier.new('NERV', 'MELCHIOR', 'GENDO', 'COMPUTER') … … 150 152 :external_ref => party_ref, 151 153 :identifier => identifiers)} 154 152 155 terminology_id = Terminology_ID.new('test','0.04') 153 156 code_phrase = Code_Phrase.new('self', terminology_id) 154 dv_coded_text = DV_Coded_Text.new('Seele', terminology_id)157 dv_coded_text = DV_Coded_Text.new('Seele',code_phrase) 155 158 assert_nothing_raised(Exception){ 156 159 @party_related = Party_Related.new(:name => 'GEHIRN', 157 160 :relationship => dv_coded_text)} 158 159 161 dv_text = DV_Text.new('commiter') 162 dv_coded_text = DV_Coded_Text.new('present',terminology_id) 163 dv_date_time1 = DV_Date_Time.new('2009-07-04T16:30:00') 164 dv_date_time2 = DV_Date_Time.new('2009-07-14T00:00:00') 165 dv_interval = DV_Interval.new(dv_date_time1, dv_date_time2) 166 assert_nothing_raised(Exception){ 167 @participation = Participation.new(:performer => @party_proxy, 168 :function => dv_text, 169 :mode => dv_coded_text, 170 :time => dv_interval)} 171 dv_date_time = DV_Date_Time.new('2009-07-04T18:56:00') 172 terminology_id = Terminology_ID.new('openehr','1.0.2') 173 code_phrase = Code_Phrase.new('249', terminology_id) 174 dv_coded_text = DV_Coded_Text.new('creation', code_phrase) 175 dv_text = DV_Text.new('test environment') 176 assert_nothing_raised(Exception){ 177 @audit_details = Audit_Details.new(:system_id => 'MAGI', 178 :committer => @party_proxy, 179 :time_committed => dv_date_time, 180 :change_type => dv_coded_text, 181 :description => dv_text)} 160 182 # change_type = OpenEHR::RM::Data_Types::Text::DV_Text.new('audit_type') 161 183 # time_committed = OpenEHR::RM::Data_Types::Quantity::Date_Time::DV_Date_Time.new(2008) … … 167 189 assert_instance_of Party_Self, @party_self 168 190 assert_instance_of Party_Identified, @party_identified 191 assert_instance_of Participation, @participation 192 assert_instance_of Audit_Details, @audit_details 169 193 end 170 194 … … 191 215 assert_equal 'GEHIRN', @party_related.name 192 216 end 217 218 def test_participation 219 assert_equal 'unknown', @participation.performer.external_ref.namespace 220 assert_equal 'commiter', @participation.function.value 221 assert_equal 'present', @participation.mode.value 222 assert_equal 2009, @participation.time.lower.year 223 end 224 225 def test_audit_details 226 assert_equal 'MAGI', @audit_details.system_id 227 assert_equal 'unknown', @audit_details.committer.external_ref.namespace 228 assert_equal '2009-07-04T18:56:00', @audit_details.time_committed.as_string 229 assert_equal 'creation', @audit_details.change_type.value 230 assert_equal 'test environment', @audit_details.description.value 231 end 193 232 end 194 233
Note:
See TracChangeset
for help on using the changeset viewer.