Class: ODDB::View::Drugs::TestRootResultList

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_view/drugs/resultlist.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



222
223
224
# File 'test/test_view/drugs/resultlist.rb', line 222

def setup
  @list = View::Drugs::RootResultList.new([StubResultListModel.new], StubResultListSession.new)
end

- (Object) test_hash_insert1



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'test/test_view/drugs/resultlist.rb', line 225

def test_hash_insert1
  foo = {
    [0,0]  => 0,
    [1,0]  => 1,
    [2,0]  => 2,
  }
  expected = {
    [0,0]  => 0,
    [1,0]  => 1,
    [2,0]  => "a",
    [3,0]  => 2,
  }
  @list.hash_insert(foo, [2,0], "a")
  assert_equal(expected, foo)
end

- (Object) test_hash_insert2



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'test/test_view/drugs/resultlist.rb', line 240

def test_hash_insert2
  foo = {
    [0,0,0]  => "0a",
    [0,0,1]  => "0b",
    [0,0,2]  => "0c",
    [1,0]  => 1,
    [2,0]  => 2,
  }
  expected = {
    [0,0]  => "a",
    [1,0,0]  => "0a",
    [1,0,1]  => "0b",
    [1,0,2]  => "0c",
    [2,0]  => 1,
    [3,0]  => 2,
  }
  @list.hash_insert(foo, [0,0], "a")
  assert_equal(expected, foo)
end