Index: ruby/trunk/lib/models/tests/test_reference_model.rb
===================================================================
--- ruby/trunk/lib/models/tests/test_reference_model.rb	(revision 104)
+++ ruby/trunk/lib/models/tests/test_reference_model.rb	(revision 105)
@@ -10,8 +10,4 @@
     @translation_details = OpenEHR::RM::Common::Resource::TRANSLATION_DETAILS.new(nil,nil,nil,nil,nil)
 #    @openehr_definitions = OpenEHR::RM::Support::Definition::OpenEHR_Definitions.new
-    @dv_text = OpenEHR::RM::Data_Types::Text::DV_Text.new("valid value")
-    @dv_coded_text = OpenEHR::RM::Data_Types::Text::DV_Coded_Text.new("valid value", "AT1000")
-    @dv_paragraph = OpenEHR::RM::Data_Types::Text::DV_Paragraph.new(Set.new(["test1", "test2"]))
-    @term_mapping = OpenEHR::RM::Data_Types::Text::Term_Mapping.new('=',@dv_coded_text,"TEST")
 #    @code_phrase = OpenEHR::RM::Data_Types::Text::Code_Phrase.new
 #    @agent = OpenEHR::RM::Demogrphic::Agent.new
@@ -24,7 +20,4 @@
     assert_instance_of OpenEHR::RM::Common::Resource::AUTHORED_RESOURCE, @authored_resource
     assert_instance_of OpenEHR::RM::Common::Resource::TRANSLATION_DETAILS, @translation_details
-    assert_instance_of OpenEHR::RM::Data_Types::Text::DV_Text, @dv_text
-    assert_instance_of OpenEHR::RM::Data_Types::Text::DV_Coded_Text, @dv_coded_text
-    assert_instance_of OpenEHR::RM::Data_Types::Text::Term_Mapping, @term_mapping
 #    assert_instance_of OpenEHR::RM::Demogrphic::Agent, @agent
 #    assert_instance_of OpenEHR::RM::Demogrphic::Organisation, @organisation
@@ -38,43 +31,4 @@
     assert_equal("\r", OpenEHR::RM::Data_Types::Basic::Data_Value::CR)
     assert_equal("\n", OpenEHR::RM::Data_Types::Basic::Data_Value::LF)
-  end
-
-  def test_dv_text
-    assert_equal("valid value", @dv_text.value)
-    assert_raise(ArgumentError){@dv_text.value = "not valid value\n"}
-    assert_raise(ArgumentError){@dv_text.value = nil }
-    assert_raise(ArgumentError){@dv_text.value = "" }
-    assert_raise(ArgumentError){@dv_text.formatting = "" }
-    assert_raise(ArgumentError){@dv_text.encoding = ""}
-    assert_raise(ArgumentError){@dv_text.language = ""}
-    assert_raise(ArgumentError){@dv_text.mappings = Set.new}
-    assert_raise(ArgumentError){@dv_text.mappings = ""}
-    assert_raise(ArgumentError){@dv_text.language = ""}
-  end
-
-  def test_dv_coded_text
-    assert_equal("valid value", @dv_coded_text.value)
-    assert_equal("AT1000", @dv_coded_text.defining_code)
-    assert_raise(ArgumentError){@dv_coded_text.defining_code=nil}
-  end
-
-  def test_dv_paragraph
-    assert_equal((Set.new ["test1", "test2"]), @dv_paragraph.items)
-    assert_raise(ArgumentError){@dv_paragraph.items=Set.new}
-  end
-
-  def test_term_mapping
-    assert_equal '=', @term_mapping.match
-    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('>')
-    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('=')
-    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('<')
-    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('?')
-    assert !OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('!')
-    assert_equal @dv_coded_text, @term_mapping.purpose
-    assert_equal "TEST", @term_mapping.target
-    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new}
-    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new('!',@dv_coded_text, "invalid case")}
-    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new('=',nil , "invalid case")}
-    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new('=',@dv_coded_text, nil)}
   end
 end
@@ -289,5 +243,5 @@
 
   def test_locatable_ref
-# test constructorpp
+# test constructor
     assert_equal 'unknown', @locatable_ref.namespace
     assert_equal 'PERSON', @locatable_ref.type
@@ -395,4 +349,5 @@
 end
 
+
 class RM_Data_Types_Basic_Test < Test::Unit::TestCase
   def setup
@@ -446,4 +401,5 @@
 end
 
+# fixed
 class RM_Data_Types_URI_Test < Test::Unit::TestCase
   def setup
@@ -473,5 +429,58 @@
       @dv_ehr_uri.value="svn://www.openehr.jp/openehr-jp/" }
   end
-
+end
+
+class RM_Data_Types_Text_Test < Test::Unit::TestCase
+  def setup
+    @dv_text = OpenEHR::RM::Data_Types::Text::DV_Text.new("valid value")
+    @dv_coded_text = OpenEHR::RM::Data_Types::Text::DV_Coded_Text.new("valid value", "AT1000")
+    @dv_paragraph = OpenEHR::RM::Data_Types::Text::DV_Paragraph.new(Set.new(["test1", "test2"]))
+    @term_mapping = OpenEHR::RM::Data_Types::Text::Term_Mapping.new('=',@dv_coded_text,"TEST")
+  end
+
+  def test_init
+    assert_instance_of OpenEHR::RM::Data_Types::Text::DV_Text, @dv_text
+    assert_instance_of OpenEHR::RM::Data_Types::Text::DV_Coded_Text, @dv_coded_text
+    assert_instance_of OpenEHR::RM::Data_Types::Text::Term_Mapping, @term_mapping
+  end
+
+  def test_dv_text
+    assert_equal("valid value", @dv_text.value)
+    assert_raise(ArgumentError){@dv_text.value = "not valid value\n"}
+    assert_raise(ArgumentError){@dv_text.value = nil }
+    assert_raise(ArgumentError){@dv_text.value = "" }
+    assert_raise(ArgumentError){@dv_text.formatting = "" }
+    assert_raise(ArgumentError){@dv_text.encoding = ""}
+    assert_raise(ArgumentError){@dv_text.language = ""}
+    assert_raise(ArgumentError){@dv_text.mappings = Set.new}
+    assert_raise(ArgumentError){@dv_text.mappings = ""}
+    assert_raise(ArgumentError){@dv_text.language = ""}
+  end
+
+  def test_dv_coded_text
+    assert_equal("valid value", @dv_coded_text.value)
+    assert_equal("AT1000", @dv_coded_text.defining_code)
+    assert_raise(ArgumentError){@dv_coded_text.defining_code=nil}
+  end
+
+  def test_dv_paragraph
+    assert_equal((Set.new ["test1", "test2"]), @dv_paragraph.items)
+    assert_raise(ArgumentError){@dv_paragraph.items=Set.new}
+  end
+
+  def test_term_mapping
+    assert_equal '=', @term_mapping.match
+    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('>')
+    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('=')
+    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('<')
+    assert OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('?')
+    assert !OpenEHR::RM::Data_Types::Text::Term_Mapping.is_valid_mach_code?('!')
+    assert_equal @dv_coded_text, @term_mapping.purpose
+    assert_equal "TEST", @term_mapping.target
+    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new}
+    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new('!',@dv_coded_text, "invalid case")}
+    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new('=',nil , "invalid case")}
+    assert_raise(ArgumentError){OpenEHR::RM::Data_Types::Text::Term_Mapping.new('=',@dv_coded_text, nil)}
+  end
 end
 
