public void redo() { if(chemModel.getMoleculeSet()!=null) chemModel.getMoleculeSet().removeAllAtomContainers(); if(chemModel.getReactionSet()!=null) chemModel.getReactionSet().removeAllReactions(); }
@Test public void testRemoveAllReactions() { IReactionSet reactionSet = (IReactionSet) newChemObject(); reactionSet.addReaction(reactionSet.getBuilder().newInstance(IReaction.class)); reactionSet.removeAllReactions(); Assert.assertEquals(0, reactionSet.getReactionCount()); }
@Test public void testIsEmpty() { IReactionSet set = (IReactionSet) newChemObject(); Assert.assertTrue("new reaction set should be empty", set.isEmpty()); set.addReaction(set.getBuilder().newInstance(IReaction.class)); Assert.assertFalse("reaction set with a single reaction should not be empty", set.isEmpty()); set.removeAllReactions(); Assert.assertTrue("reaction set with all reactions removed should be empty", set.isEmpty()); }