Class: ODDB::TestCyP450SubstrateConnection

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



68
69
70
# File 'test/test_model/cyp450connection.rb', line 68

def setup
  @connection = ODDB::CyP450SubstrateConnection.new('cyp_id')
end

- (Object) test_adjust_types



71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'test/test_model/cyp450connection.rb', line 71

def test_adjust_types
  app = flexmock 'app'
  values = {
    :cyp450 =>  'foo_id'
  }
  app.should_receive(:cyp450).and_return do |param|
    assert_equal('foo_id', param)
    'found cyp450'
  end
  result = @connection.adjust_types(values, app)
  expected = { :cyp450  => 'found cyp450' }
  assert_equal(expected, result)
end

- (Object) test_interactions_with



88
89
90
91
92
93
94
95
96
97
98
# File 'test/test_model/cyp450connection.rb', line 88

def test_interactions_with
  cyp450 = flexmock 'cyp450'
  substance = flexmock 'substance'
  cyp450.should_receive(:interactions_with).and_return do |param|
    assert_equal(param, substance)
    [ 'int_connection' ]
  end
  @connection.cyp450 = cyp450 
  result = @connection.interactions_with(substance)
  assert_equal([ 'int_connection' ], result)
end

- (Object) test_interactions_with__empty



84
85
86
87
# File 'test/test_model/cyp450connection.rb', line 84

def test_interactions_with__empty
  result = @connection.interactions_with(nil)
  assert_equal([], result)
end