Skip to content

Commit

Permalink
Test all bond types
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Oct 17, 2010
1 parent d29f631 commit 047b60e
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/test/org/openscience/cdk/libio/jena/ConvertorTest.java
Expand Up @@ -63,11 +63,24 @@ public class ConvertorTest extends CDKTestCase {
Assert.assertEquals("Unexpected diff: " + diff, 0, diff.length());
}

@Test public void roundtripBond() {
@Test public void roundtripBond_SINGLE() {
roundtripBond_Order(IBond.Order.SINGLE);
}
@Test public void roundtripBond_DOUBLE() {
roundtripBond_Order(IBond.Order.DOUBLE);
}
@Test public void roundtripBond_TRIPLE() {
roundtripBond_Order(IBond.Order.TRIPLE);
}
@Test public void roundtripBond_QUAD() {
roundtripBond_Order(IBond.Order.QUADRUPLE);
}

private void roundtripBond_Order(IBond.Order order) {
IMolecule mol = new NNMolecule();
mol.addAtom(new NNAtom("C"));
mol.addAtom(new NNAtom("C"));
mol.addBond(0,1,IBond.Order.DOUBLE);
mol.addBond(0,1,order);
Model model = Convertor.molecule2Model(mol);
IMolecule rtMol = Convertor.model2Molecule(model, builder);
String diff = AtomContainerDiff.diff(mol, rtMol);
Expand Down

0 comments on commit 047b60e

Please sign in to comment.