Class: TestDDD

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) test_equals1



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'test/test_model/atcclass.rb', line 195

def test_equals1
  ddd = ODDB::AtcClass::DDD.new('O')
  ddd.dose = ODDB::Dose.new(1, 'g')
  compare = {
    :administration_route => 'O',
    :dose => ODDB::Dose.new(1, 'g')
  }
  assert_equal(true, ddd == compare)
  compare = {
    :administration_route => 'P',
    :dose => ODDB::Dose.new(1, 'g')
  }
  assert_equal(false, ddd == compare)
  compare = {
    :administration_route => 'O',
    :dose => ODDB::Dose.new(2, 'g')
  }
  assert_equal(false, ddd == compare)
end

- (Object) test_equals2



214
215
216
217
218
219
220
221
222
223
224
225
# File 'test/test_model/atcclass.rb', line 214

def test_equals2
  ddd = ODDB::AtcClass::DDD.new('O')
  ddd.dose = ODDB::Dose.new(1, 'g')
  compare = ODDB::AtcClass::DDD.new('O')
  compare.dose = ODDB::Dose.new(1, 'g')
  assert_equal(true, ddd == compare)
  compare.dose = ODDB::Dose.new(2, 'g')
  assert_equal(false, ddd == compare)
  ddd = ODDB::AtcClass::DDD.new('P')
  compare.dose = ODDB::Dose.new(1, 'g')
  assert_equal(false, ddd == compare)
end

- (Object) test_equals3



226
227
228
229
230
# File 'test/test_model/atcclass.rb', line 226

def test_equals3
  ddd = ODDB::AtcClass::DDD.new('O')
  ddd.dose = ODDB::Dose.new(1, 'g')
  assert_equal(false, ddd == 'something else entirely')
end