Skip to content

Commit

Permalink
Ca Atom type test case added
Browse files Browse the repository at this point in the history
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
asad authored and egonw committed Aug 28, 2011
1 parent b91943a commit 517dd0c
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
Expand Up @@ -1731,6 +1731,47 @@ public void test_Hg_2() throws Exception {
expectedTypes = new String[]{"Al.3plus"}; expectedTypes = new String[]{"Al.3plus"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol); assertAtomTypes(testedAtomTypes, expectedTypes, mol);
} }

@Test
public void fix_Ca_2() throws Exception {
String molName = "Ca_2";
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IMolecule mol = builder.newInstance(IMolecule.class);
IAtom a1 = builder.newInstance(IAtom.class, "Ca");
a1.setFormalCharge(0);
mol.addAtom(a1);
IAtom a2 = builder.newInstance(IAtom.class, "C");
a2.setFormalCharge(0);
mol.addAtom(a2);
IAtom a3 = builder.newInstance(IAtom.class, "C");
a3.setFormalCharge(0);
mol.addAtom(a3);
IBond b1 = builder.newInstance(IBond.class, a1, a2, IBond.Order.SINGLE);
mol.addBond(b1);
IBond b2 = builder.newInstance(IBond.class, a1, a3, IBond.Order.SINGLE);
mol.addBond(b2);

String[] expectedTypes = {"Ca.2", "C.sp3", "C.sp3"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}

@Test
public void fix_Ca_1() throws Exception {
String molName1 = "Ca_1";
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IMolecule mol = builder.newInstance(IMolecule.class);
IAtom a1 = builder.newInstance(IAtom.class, "Ca");
a1.setFormalCharge(0);
mol.addAtom(a1);
IAtom a2 = builder.newInstance(IAtom.class, "C");
a2.setFormalCharge(0);
mol.addAtom(a2);
IBond b1 = builder.newInstance(IBond.class, a1, a2, IBond.Order.DOUBLE);
mol.addBond(b1);

String[] expectedTypes1 = {"Ca.1", "C.sp2"};
assertAtomTypes(testedAtomTypes, expectedTypes1, mol);
}


@Test public void testCyclopentadienyl() throws Exception { @Test public void testCyclopentadienyl() throws Exception {
IAtomContainer cp = new Molecule(); IAtomContainer cp = new Molecule();
Expand Down

0 comments on commit 517dd0c

Please sign in to comment.