Debian Codegraph @

jna-inchi-all/src/test/java/io/github/dan2097/jnainchi/SmilesToInchiTest.java

raw symbols SCIP
1 /**
2 * JNA-InChI - Library for calling InChI from Java
3 * Copyright © 2018 Daniel Lowe
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 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, see <http://www.gnu.org/licenses/>.
17 */
18 package io.github.dan2097.jnainchi;
19
20 import static org.junit.jupiter.api.Assertions.assertEquals;
21 import static org.junit.jupiter.api.Assertions.fail;
22
23 import java.io.IOException;
24
25 import org.junit.jupiter.params.ParameterizedTest;
26 import org.junit.jupiter.params.provider.CsvFileSource;
27
28 public class SmilesToInchiTest {
29
30 @ParameterizedTest
31 @CsvFileSource(resources = "smilesintegrationtests.smi", delimiter = '\t')
32 public void testConversion(String smiles, String expectedInchi) throws IOException {
33 String inchi = SmilesToInchi.toInchi(smiles).getInchi();
34 if (inchi != null) {
35 assertEquals(expectedInchi, inchi, smiles + " was misconverted as: " + inchi);
36 } else {
37 fail(smiles + " was not converted");
38 }
39 }
40 }