BeamToCDK { IAtom toCDKAtom(Atom beamAtom, int hCount) { IAtom cdkAtom = newCDKAtom(beamAtom); cdkAtom.setImplicitHydrogenCount(hCount); cdkAtom.setFormalCharge(beamAtom.charge()); if (beamAtom.isotope() >= 0) cdkAtom.setMassNumber(beamAtom.isotope()); if (beamAtom.aromatic()) cdkAtom.setIsAromatic(true); if (beamAtom.atomClass() > 0) cdkAtom.setProperty(ATOM_ATOM_MAPPING, beamAtom.atomClass()); return cdkAtom; } BeamToCDK(IChemObjectBuilder builder);   }
@Test public void methaneAtom() { IAtom a = g2c.toCDKAtom(AtomBuilder.aliphatic(Element.Carbon).hydrogens(4).build(), 4); assertThat(a.getSymbol(), is("C")); assertThat(a.getImplicitHydrogenCount(), is(4)); }
@Test public void waterAtom() { IAtom a = g2c.toCDKAtom(AtomBuilder.aliphatic(Element.Oxygen).hydrogens(2).build(), 2); assertThat(a.getSymbol(), is("O")); assertThat(a.getImplicitHydrogenCount(), is(2)); }
@Test public void oxidanide() { IAtom a = g2c.toCDKAtom(AtomBuilder.aliphatic(Element.Oxygen).hydrogens(1).anion().build(), 1); assertThat(a.getSymbol(), is("O")); assertThat(a.getImplicitHydrogenCount(), is(1)); assertThat(a.getFormalCharge(), is(-1)); }
@Test public void azaniumAtom() { IAtom a = g2c.toCDKAtom(AtomBuilder.aliphatic(Element.Nitrogen).hydrogens(4).cation().build(), 4); assertThat(a.getSymbol(), is("N")); assertThat(a.getImplicitHydrogenCount(), is(4)); assertThat(a.getFormalCharge(), is(+1)); }
@Test public void unspecifiedMass() { IAtom a = g2c.toCDKAtom(AtomBuilder.aliphatic(Element.Carbon).hydrogens(4).build(), 4); assertNull(a.getMassNumber()); }
@Test public void carbon_12() { IAtom a = g2c.toCDKAtom(AtomBuilder.aliphatic(Element.Carbon).hydrogens(4).isotope(12).build(), 4); assertThat(a.getMassNumber(), is(12)); }
@Test public void carbon_13() { IAtom a = g2c.toCDKAtom(AtomBuilder.aliphatic(Element.Carbon).hydrogens(4).isotope(13).build(), 4); assertThat(a.getMassNumber(), is(13)); }
@Test public void carbon_14() { IAtom a = g2c.toCDKAtom(AtomBuilder.aliphatic(Element.Carbon).hydrogens(4).isotope(14).build(), 4); assertThat(a.getMassNumber(), is(14)); }
@Test public void aromatic() { IAtom a = g2c.toCDKAtom(AtomBuilder.aromatic(Element.Carbon).build(), 0); assertTrue(a.getFlag(CDKConstants.ISAROMATIC)); }