Class: TestPatinfoDocument

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_model/patinfo.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) test_chapter_names



128
129
130
131
132
133
134
135
# File 'test/test_model/patinfo.rb', line 128

def test_chapter_names
  doc = ODDB::PatinfoDocument.new
  expected = [ :name, :company, :galenic_form, :effects, :purpose,
               :amendments, :contra_indications, :precautions, :pregnancy,
               :usage, :unwanted_effects, :general_advice, :other_advice,
               :composition, :packages, :distribution, :fabrication, :date ]
  assert_equal expected, doc.chapter_names
end

- (Object) test_to_s1



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'test/test_model/patinfo.rb', line 58

def test_to_s1
  doc = ODDB::PatinfoDocument.new
  doc.name = "name"
  doc.company = "company"
  doc.galenic_form = "galenic_form"
  doc.effects = "effects"
  doc.purpose = "purpose"
  doc.amendments = "amendments"
  doc.contra_indications = "contra_indications"
  doc.precautions = "precautions"
  doc.pregnancy = "pregnancy"
  doc.usage = "usage"
  doc.unwanted_effects = "unwanted_effects"
  doc.general_advice = "general_advice"
  doc.other_advice = "other_advice"
  doc.composition = "composition"
  doc.packages = "packages"
  doc.distribution = "distribution"
  doc.date = "date"
  doc.iksnrs = "iksnrs" 
  expected = "name\ncompany\ngalenic_form\neffects\npurpose\namendments\ncontra_indications\nprecautions\npregnancy\nusage\nunwanted_effects\ngeneral_advice\nother_advice\ncomposition\npackages\ndistribution\ndate\n"
  assert_equal(expected.strip, doc.to_s)
end

- (Object) test_to_s2



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'test/test_model/patinfo.rb', line 100

def test_to_s2
  doc = ODDB::PatinfoDocument.new
  doc.name = "name"
  doc.company = "company"
  doc.galenic_form = "galenic_form"
  doc.effects = "effects"
  doc.contra_indications = "contra_indications"
  doc.precautions = "precautions"
  doc.unwanted_effects = "unwanted_effects"
  doc.general_advice = "general_advice"
  doc.packages = "packages"
  doc.date = "date"
  doc.iksnrs = "iksnrs" 
  expected = "name\ncompany\ngalenic_form\neffects\ncontra_indications\nprecautions\nunwanted_effects\ngeneral_advice\npackages\ndate\n"
  assert_equal(expected.strip, doc.to_s)
end