| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 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 |
} |