Changeset 91 for ruby/trunk/lib/models/tests
- Timestamp:
- Jul 27, 2008, 8:29:31 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/lib/models/tests/test_reference_model.rb
r90 r91 148 148 assert_nothing_raised(Exception){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new("0.0.3")} 149 149 @terminology_id = OpenEHR::RM::Support::Identification::Terminology_ID.new('terminology','version') 150 @archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0. 3")150 @archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("0.0.5", "biochemistry result_cholesterol", "entry", "ehr_rm", "openehr","cholesterol","0.0.3") 151 151 end 152 152 153 153 def test_init 154 154 assert_instance_of OpenEHR::RM::Support::Identification::Object_ID, @object_id 155 assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, @archetype_id 155 156 assert_instance_of OpenEHR::RM::Support::Identification::Terminology_ID, @terminology_id 156 assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, @archetype_id157 157 end 158 158 159 def test_object_id 160 assert_equal "0.0.3", @object_id.value 161 assert_nothing_raised(Exception){@object_id.value = "0.0.4"} 162 assert_equal "0.0.4", @object_id.value 163 assert_raise(ArgumentError){@object_id.value=nil} 164 assert_raise(ArgumentError){@object_id.value=""} 165 assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new} 166 assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new(nil)} 167 assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Object_ID.new("")} 168 end 169 170 def test_archetype_id 171 assert_equal "0.0.5", @archetype_id.value 172 assert_nothing_raised(Exception){@archetype_id.value = "0.0.6"} 173 assert_equal "0.0.6", @archetype_id.value 174 assert_raise(ArgumentError){@archetype_id.value=nil} 175 assert_raise(ArgumentError){@archetype_id.value=""} 176 assert_raise(ArgumentError){@archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new} 177 assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Archetype_ID.new(nil)} 178 assert_raise(ArgumentError){@object_id = OpenEHR::RM::Support::Identification::Archetype_ID.new("")} 179 180 assert_equal "biochemistry result_cholesterol", @archetype_id.domain_concept 181 182 assert_equal "entry", @archetype_id.rm_name 183 184 assert_equal "ehr_rm", @archetype_id.rm_entity 185 186 assert_equal "openehr", @archetype_id.rm_originator 187 188 assert_equal "cholesterol", @archetype_id.specialisation 189 190 assert_equal "0.0.3", @archetype_id.version_id 191 192 end 159 193 end
Note:
See TracChangeset
for help on using the changeset viewer.