From 3691b262819de938c413e90f160ea46532ff3560 Mon Sep 17 00:00:00 2001 From: John May Date: Mon, 28 Nov 2016 23:01:10 +0000 Subject: [PATCH] Auxiliary test. --- .../formula/IsotopePatternGeneratorTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tool/formula/src/test/java/org/openscience/cdk/formula/IsotopePatternGeneratorTest.java b/tool/formula/src/test/java/org/openscience/cdk/formula/IsotopePatternGeneratorTest.java index 9fa71188bf..bc1580a226 100644 --- a/tool/formula/src/test/java/org/openscience/cdk/formula/IsotopePatternGeneratorTest.java +++ b/tool/formula/src/test/java/org/openscience/cdk/formula/IsotopePatternGeneratorTest.java @@ -313,4 +313,23 @@ public void testGetIsotopes_IMolecularFormula_Charged() { Assert.assertNotEquals(ip1.getIsotope(0).getMass(), ip2.getIsotope(0).getMass()); } + @Test + public void testGetIsotopes_IMolecularFormula_deprotonate() { + IsotopePatternGenerator isogen = new IsotopePatternGenerator(.1); + + IMolecularFormula mf1 = MolecularFormulaManipulator.getMolecularFormula("C6H12O6", builder); + MolecularFormulaManipulator.adjustProtonation(mf1, -1); + IsotopePattern ip1 = isogen.getIsotopes(mf1); + Assert.assertEquals(1, ip1.getNumberOfIsotopes()); + + isogen = new IsotopePatternGenerator(.1); + IMolecularFormula mf2 = MolecularFormulaManipulator.getMolecularFormula("C6H11O6", builder); + IsotopePattern ip2 = isogen.getIsotopes(mf2); + Assert.assertEquals(1, ip2.getNumberOfIsotopes()); + + Assert.assertEquals(ip1.getIsotope(0).getMass(), ip2.getIsotope(0).getMass(), 0.001); + } + + + }