Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added a unit test for charged entities
  • Loading branch information
egonw authored and rajarshi committed Jan 31, 2012
1 parent 3005193 commit b635613
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/org/openscience/cdk/io/program/Mopac7WriterTest.java
Expand Up @@ -30,6 +30,7 @@
import org.junit.Test;
import org.openscience.cdk.Atom;
import org.openscience.cdk.AtomContainer;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.io.ChemObjectWriterTest;
import org.openscience.cdk.io.listener.PropertiesListener;
Expand Down Expand Up @@ -105,4 +106,17 @@ public class Mopac7WriterTest extends ChemObjectWriterTest {
Assert.assertTrue(strWriter.toString().contains("THIS IS NOT GOING TO WORK"));
}

@Test public void testChargedCompounds() throws Exception {
IAtomContainer mol = new AtomContainer();
IAtom aluminum = new Atom("Al");
aluminum.setFormalCharge(+3);
mol.addAtom(aluminum);

StringWriter strWriter = new StringWriter();
Mopac7Writer writer = new Mopac7Writer(strWriter);
writer.write(mol);
writer.close();
Assert.assertTrue(strWriter.toString().contains("CHARGE=3"));
}

}

0 comments on commit b635613

Please sign in to comment.