source: ruby/trunk/models/tests/test_archetype_model.rb@ 4

Last change on this file since 4 was 4, checked in by KOBAYASHI, Shinji, 16 years ago

restructuring repository tree

File size: 2.0 KB
Line 
1require 'test/unit'
2require 'am.rb'
3require 'rm.rb'
4
5class ArchetypeModelTest < Test::Unit::TestCase
6 def setup
7 @archetype = OpenEHR::AM::Archetype::Archetype.new(nil,nil,nil,nil,nil,nil,nil,nil)
8 @archetype_description = OpenEHR::AM::Archetype::Archetype_Description::Archetype_Description.new
9 @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::Archetype_Constraint.new
10 @assertion = OpenEHR::AM::Archetype::Constraint_Model::Assertion::Assertion.new
11 @c_primitive = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Primitive.new
12 @c_boolean = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean.new(true, true, true)
13 @c_integer = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Integer.new
14 @archetype_ontology = OpenEHR::AM::Archetype::Ontology::Archetype_Ontology.new
15 end
16
17 def test_init
18 assert_instance_of OpenEHR::AM::Archetype::Ontology::Archetype_Ontology, @archetype_ontology
19 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Archetype_Constraint, @archetype_constraint
20 assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::Archetype_Description, @archetype_description
21 assert_instance_of OpenEHR::AM::Archetype::Archetype, @archetype
22 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Assertion::Assertion, @assertion
23 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Primitive, @c_primitive
24 assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean, @c_boolean
25 end
26 def test_primitive
27 assert @c_boolean.true_valid?
28 assert @c_boolean.false_valid?
29 assert @c_boolean.assumed_value
30 assert @c_boolean.has_assumed_value?
31 assert @c_boolean.default_value
32 assert @c_boolean.default_value(true)
33 assert_raise(ArgumentError) {@c_boolean.set_true_valid(false); @c_boolean.set_false_valid(false)}
34 assert_raise(ArgumentError) {OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean.new(false,false,false)}
35 end
36end
37
Note: See TracBrowser for help on using the repository browser.