diff options
author | Christoph Helma <helma@in-silico.ch> | 2015-11-04 17:50:32 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2015-11-04 17:50:32 +0100 |
commit | c23f4b8a915c0df4f34b6c3787829e1f513df571 (patch) | |
tree | 298faed0b20077615357a6bc0a4b6d7e61bd8a16 /test/compound.rb | |
parent | ca2bb0f90335b1f2c4ecc28ee423e85b281ffcf0 (diff) | |
parent | 2081bda2b72f34758847fe699fecf890dae1e3df (diff) |
Merge branch 'development' of github.com:opentox/lazar into development
Diffstat (limited to 'test/compound.rb')
-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 |