Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hg Test cases added
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
asad authored and egonw committed Aug 20, 2011
1 parent 888ab40 commit 0e3d587
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions src/test/org/openscience/cdk/atomtype/CDKAtomTypeMatcherTest.java
Expand Up @@ -1520,6 +1520,92 @@ public void testTetrahydropyran() throws Exception {
String[] expectedTypes = new String[]{"Hg.minus", "O.plus.sp2", "C.sp2", "C.sp2", "N.sp2"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}

@Test
public void test_Hg_2plus() throws Exception {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IMolecule mol = builder.newInstance(IMolecule.class);
IAtom a1 = builder.newInstance(IAtom.class, "Hg");
a1.setFormalCharge(2);
mol.addAtom(a1);


String[] expectedTypes = {"Hg.2plus"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}

@Test
public void test_Hg_plus() throws Exception {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IMolecule mol = builder.newInstance(IMolecule.class);
IAtom a1 = builder.newInstance(IAtom.class, "Hg");
a1.setFormalCharge(1);
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.SINGLE);
mol.addBond(b1);


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

@Test
public void test_Hg_metallic() throws Exception {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IMolecule mol = builder.newInstance(IMolecule.class);
IAtom a1 = builder.newInstance(IAtom.class, "Hg");
a1.setFormalCharge(0);
mol.addAtom(a1);


String[] expectedTypes = {"Hg.metallic"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}

@Test
public void test_Hg_1() throws Exception {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IMolecule mol = builder.newInstance(IMolecule.class);
IAtom a1 = builder.newInstance(IAtom.class, "Hg");
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[] expectedTypes = {"Hg.1", "C.sp2"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}

@Test
public void test_Hg_2() throws Exception {
IChemObjectBuilder builder = DefaultChemObjectBuilder.getInstance();
IMolecule mol = builder.newInstance(IMolecule.class);
IAtom a1 = builder.newInstance(IAtom.class, "Hg");
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 = {"Hg.2", "C.sp3", "C.sp3"};
assertAtomTypes(testedAtomTypes, expectedTypes, mol);
}


@Test public void testPoloniumComplex() throws Exception {
IMolecule mol = new Molecule();
Expand Down

0 comments on commit 0e3d587

Please sign in to comment.