1 /* Copyright (C) 2011  Egon Willighagen <egonw@users.sf.net>
2  *
3  * Contact: cdk-devel@lists.sourceforge.net
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public License
7  * as published by the Free Software Foundation; either version 2.1
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 package org.openscience.cdk.qsar.descriptors.molecular;
20 
21 import org.junit.Assert;
22 import org.junit.Before;
23 import org.junit.Test;
24 import org.openscience.cdk.exception.CDKException;
25 import org.openscience.cdk.exception.InvalidSmilesException;
26 import org.openscience.cdk.interfaces.IAtomContainer;
27 import org.openscience.cdk.silent.SilentChemObjectBuilder;
28 import org.openscience.cdk.qsar.result.DoubleResult;
29 import org.openscience.cdk.smiles.SmilesParser;
30 
31 /**
32  * @cdk.module test-qsarmolecular
33  */
34 public class VABCDescriptorTest extends MolecularDescriptorTest {
35 
36     @Before
setUp()37     public void setUp() throws Exception {
38         setDescriptor(VABCDescriptor.class);
39     }
40 
41     @Test
testIronChloride()42     public void testIronChloride() throws InvalidSmilesException, CDKException {
43         IAtomContainer ironChloride = new SmilesParser(SilentChemObjectBuilder.getInstance()).parseSmiles("Cl[Fe]Cl");
44         Assert.assertEquals(Double.NaN, ((DoubleResult) descriptor.calculate(ironChloride).getValue()).doubleValue(),
45                 0.01);
46     }
47 
48 }
49