Skip to content

Commit

Permalink
Signature quotient graph test method
Browse files Browse the repository at this point in the history
  • Loading branch information
gilleain authored and egonw committed Jun 23, 2010
1 parent 2609f1b commit 0d0a95e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down
Expand Up @@ -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;

/**
Expand All @@ -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,
Expand Down

0 comments on commit 0d0a95e

Please sign in to comment.