CDKToBeam { Atom toBeamAtom(IAtom atom) throws CDKException { return toBeamAtom(atom, flavour); } CDKToBeam();   CDKToBeam(int flavour);   }
@Test(expected = NullPointerException.class) public void noImplicitHCount() throws Exception { new CDKToBeam().toBeamAtom(new Atom("C")); }
@Test(expected = NullPointerException.class) public void noSymbol() throws Exception { new CDKToBeam().toBeamAtom(new Atom()); }
@Test public void unknownSymbol() throws Exception { IAtom a = new PseudoAtom("ALA"); a.setImplicitHydrogenCount(0); assertThat(new CDKToBeam().toBeamAtom(a).element(), is(Element.Unknown)); }
@Test public void unknownSymbol_Pseudo() throws Exception { IAtom a = new PseudoAtom("R1"); a.setImplicitHydrogenCount(0); assertThat(new CDKToBeam().toBeamAtom(a).element(), is(Element.Unknown)); }
@Test public void methane_Atom() throws Exception { IAtom a = new Atom("C"); a.setImplicitHydrogenCount(4); assertThat(new CDKToBeam().toBeamAtom(a).element(), is(Element.Carbon)); assertThat(new CDKToBeam().toBeamAtom(a).hydrogens(), is(4)); }
@Test public void water_Atom() throws Exception { IAtom a = new Atom("O"); a.setImplicitHydrogenCount(2); assertThat(new CDKToBeam().toBeamAtom(a).element(), is(Element.Oxygen)); assertThat(new CDKToBeam().toBeamAtom(a).hydrogens(), is(2)); }
@Test public void chargedAtom() throws Exception { IAtom a = new Atom("C"); a.setImplicitHydrogenCount(0); for (int chg = -10; chg < 10; chg++) { a.setFormalCharge(chg); assertThat(new CDKToBeam().toBeamAtom(a).charge(), is(chg)); } }
@Test public void aliphaticAtom() throws Exception { IAtom a = new Atom("C"); a.setImplicitHydrogenCount(0); assertFalse(new CDKToBeam().toBeamAtom(a).aromatic()); }
@Test public void aromaticAtom() throws Exception { IAtom a = new Atom("C"); a.setImplicitHydrogenCount(0); a.setFlag(CDKConstants.ISAROMATIC, true); assertTrue(new CDKToBeam().toBeamAtom(a).aromatic()); }
@Test public void unspecifiedIsotope() throws Exception { IAtom a = new Atom("C"); a.setImplicitHydrogenCount(0); assertThat(new CDKToBeam().toBeamAtom(a).isotope(), is(-1)); }
@Test public void specifiedIsotope() throws Exception { IAtom a = new Atom("C"); a.setImplicitHydrogenCount(0); a.setMassNumber(13); assertThat(new CDKToBeam().toBeamAtom(a).isotope(), is(13)); }
@Test public void noDefaultIsotope() throws Exception { IAtom a = new Atom("C"); a.setImplicitHydrogenCount(0); a.setMassNumber(12); assertThat(new CDKToBeam().toBeamAtom(a).isotope(), is(12)); }
@Test public void pseudoAtom_nullH() throws Exception { assertThat(new CDKToBeam().toBeamAtom(new PseudoAtom("R")).hydrogens(), is(0)); assertThat(new CDKToBeam().toBeamAtom(new PseudoAtom("*")).hydrogens(), is(0)); assertThat(new CDKToBeam().toBeamAtom(new PseudoAtom("R1")).hydrogens(), is(0)); }