diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compound.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/compound.rb b/test/compound.rb index ff20c1c..50cc5aa 100644 --- a/test/compound.rb +++ b/test/compound.rb @@ -184,4 +184,18 @@ print c.sdf #assert_equal neighbors, neighbors2 end end + + def test_molecular_weight + c = OpenTox::Compound.from_smiles "CC(=O)CC(C)C" + assert_equal 100.15888, c.molecular_weight + end + + def test_mg_conversions + c = OpenTox::Compound.from_smiles "O" + mw = c.molecular_weight + assert_equal 18.01528, mw + assert_equal 0.8105107141417474, c.logmmol_to_mg(4.34688225631145, mw) + assert_equal 9007.64, c.mmol_to_mg(500, mw) + assert_equal 2437.9999984148976, c.logmg_to_mg(3.387033701) + end end |