Permalink
Browse files

Signature quotient graph test method

  • Loading branch information...
1 parent 2609f1b commit 0d0a95e857408019e4f532eb4d50118923f30cf3 @gilleain gilleain committed with egonw Jun 15, 2010
@@ -23,6 +23,7 @@
package org.openscience.cdk.signature;
import org.openscience.cdk.annotations.TestClass;
+import org.openscience.cdk.annotations.TestMethod;
import org.openscience.cdk.interfaces.IAtom;
import org.openscience.cdk.interfaces.IAtomContainer;
@@ -74,6 +75,7 @@ public SignatureQuotientGraph(IAtomContainer atomContainer, int height) {
}
@Override /** {@inheritDoc} */
+ @TestMethod("isConnectedTest")
public boolean isConnected(int index1, int index2) {
IAtom atom1 = atomContainer.getAtom(index1);
IAtom atom2 = atomContainer.getAtom(index2);
@@ -25,6 +25,9 @@
import junit.framework.Assert;
import org.junit.Test;
+import org.openscience.cdk.interfaces.IAtom;
+import org.openscience.cdk.interfaces.IAtomContainer;
+import org.openscience.cdk.interfaces.IBond;
import org.openscience.cdk.interfaces.IMolecule;
/**
@@ -34,6 +37,17 @@
*/
public class SignatureQuotientGraphTest extends AbstractSignatureTest {
+ @Test
+ public void isConnectedTest() {
+ IAtomContainer singleBond = builder.newInstance(IAtomContainer.class);
+ singleBond.addAtom(builder.newInstance(IAtom.class, "C"));
+ singleBond.addAtom(builder.newInstance(IAtom.class, "C"));
+ singleBond.addBond(0, 1, IBond.Order.SINGLE);
+ SignatureQuotientGraph quotientGraph =
+ new SignatureQuotientGraph(singleBond);
+ Assert.assertTrue(quotientGraph.isConnected(0, 1));
+ }
+
public void checkParameters(SignatureQuotientGraph qGraph,
int expectedVertexCount,
int expectedEdgeCount,

0 comments on commit 0d0a95e

Please sign in to comment.