Skip to content

Commit

Permalink
Exceptions when clone atomless ISingleElectron and ILonePair too
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Jul 22, 2010
1 parent d71c31c commit c5d4cd3
Showing 1 changed file with 18 additions and 0 deletions.
Expand Up @@ -205,6 +205,24 @@ public abstract class AbstractAtomContainerTest extends AbstractChemObjectTest {
Assert.assertEquals(0, clone.getBond(0).getAtomCount());
}

@Test public void testClone_AtomlessILonePair() throws Exception {
IAtomContainer molecule = (IAtomContainer)newChemObject();
ILonePair lonePair = molecule.getBuilder().newLonePair();
molecule.addLonePair(lonePair);
Assert.assertEquals(lonePair, molecule.getLonePair(0));
IAtomContainer clone = (IAtomContainer)molecule.clone();
Assert.assertNotNull(clone.getLonePair(0));
}

@Test public void testClone_AtomlessISingleElectron() throws Exception {
IAtomContainer molecule = (IAtomContainer)newChemObject();
ISingleElectron singleElectron = molecule.getBuilder().newSingleElectron();
molecule.addSingleElectron(singleElectron);
Assert.assertEquals(singleElectron, molecule.getSingleElectron(0));
IAtomContainer clone = (IAtomContainer)molecule.clone();
Assert.assertNotNull(clone.getSingleElectron(0));
}

@Test public void testClone_ILonePair() throws Exception {
IAtomContainer molecule = (IAtomContainer)newChemObject();
IAtom atom1 = molecule.getBuilder().newAtom("C");
Expand Down

0 comments on commit c5d4cd3

Please sign in to comment.