Skip to content

Commit

Permalink
Last few bits: the core module is now fully tested\!
Browse files Browse the repository at this point in the history
git-svn-id: https://cdk.svn.sourceforge.net/svnroot/cdk/trunk/cdk@3558 eb4e18e3-b210-0410-a6ab-dec725e4b171
  • Loading branch information
egonw committed Jan 4, 2005
1 parent d781e82 commit f6b460e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/org/openscience/cdk/test/AtomContainerTest.java
Expand Up @@ -1656,4 +1656,31 @@ public void reset() {
changed = false;
}
}

public void testAddAtomParity_AtomParity() {
testGetAtomParity_Atom();
}

public void testGetSingleElectronSum_Atom() {
// another rather artifial example
Molecule acetone = new Molecule();
Atom c = new Atom("C");
Atom o = new Atom("O");
acetone.addAtom(c);
acetone.addAtom(o);
Bond b1 = new Bond(c, o, 2.0);
acetone.addElectronContainer(b1);
SingleElectron single1 = new SingleElectron(c);
SingleElectron single2 = new SingleElectron(c);
SingleElectron single3 = new SingleElectron(o);
acetone.addElectronContainer(single1);
acetone.addElectronContainer(single2);
acetone.addElectronContainer(single3);

assertEquals(2, acetone.getSingleElectron(c).length);
assertEquals(1, acetone.getSingleElectron(o).length);
assertEquals(single1, acetone.getSingleElectron(c)[0]);
assertEquals(single2, acetone.getSingleElectron(c)[1]);
assertEquals(single3, acetone.getSingleElectron(o)[0]);
}
}
18 changes: 18 additions & 0 deletions src/org/openscience/cdk/test/ReactionTest.java
Expand Up @@ -308,4 +308,22 @@ public void testClone() {
assertTrue(clone instanceof Reaction);
}

public void testClone_Mapping() {
fail("Affected by bug #1095690");
}

public void testAddMapping_Mapping() {
Reaction reaction = new Reaction();
Mapping mapping = new Mapping(new Atom("C"), new Atom("C"));
reaction.addMapping(mapping);

Mapping[] mappings = reaction.getMappings();
assertNotNull(mappings);
assertEquals(1, mappings.length);
assertEquals(mapping, mappings[0]);
}

public void testGetMappings() {
testAddMapping_Mapping();
}
}

0 comments on commit f6b460e

Please sign in to comment.