IAtom readAtomFast(String line, IChemObjectBuilder builder, int lineNum) throws CDKException, IOException { return readAtomFast(line, builder, Collections.<IAtom,Integer>emptyMap(), lineNum); }
@Test public void lineLength_excessSpace() throws Exception { IAtom a1 = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 ", builder, 1); IAtom a2 = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 ", builder, 1); }
@Test public void lineLength_truncated() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 ", builder, 1); }
@Test public void lineLength_exact() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0", builder, 1); }
@Test public void valence_invalid() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 16 0 0 0 0 0 0", builder, 1); assertThat(atom.getValency(), is(nullValue())); }
@Test public void symbol_N() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0", builder, 1); assertThat(atom.getSymbol(), is("N")); }
@Test public void mapping() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 0 0 0 0 1 0 0", builder, 1); assertThat(atom.getProperty(CDKConstants.ATOM_ATOM_MAPPING, Integer.class), is(1)); }
@Test public void charge_trication() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 3 0 0 0 0 0 0 0 0 0 0", builder, 1); assertThat(atom.getFormalCharge(), is(1)); }
@Test public void charge_doubletradical() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 4 0 0 0 0 0 0 0 0 0 0", builder, 1); assertThat(atom.getFormalCharge(), is(0)); }
@Test public void valence_0() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 15 0 0 0 0 0 0", builder, 1); assertThat(atom.getValency(), is(0)); }
@Test public void mapping_999() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 0 0 0 0999 0 0", builder, 1); assertThat(atom.getProperty(CDKConstants.ATOM_ATOM_MAPPING, Integer.class), is(999)); }
@Test public void symbol_C() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0", builder, 1); assertThat(atom.getSymbol(), is("C")); }
@Test public void massDiff_c13() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 1 0 0 0 0 0 0 0 0 0 0 0", builder, 1); assertThat(atom.getMassNumber(), is(13)); }
@Test public void charge_dianion() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 6 0 0 0 0 0 0 0 0 0 0", builder, 1); assertThat(atom.getFormalCharge(), is(-2)); }
@Test public void charge_trianion() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 7 0 0 0 0 0 0 0 0 0 0", builder, 1); assertThat(atom.getFormalCharge(), is(-3)); }
@Test public void valence_1() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 1 0 0 0 0 0 0", builder, 1); assertThat(atom.getValency(), is(1)); }
@Test public void valence_14() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 14 0 0 0 0 0 0", builder, 1); assertThat(atom.getValency(), is(14)); }
@Test public void massDiff_c11() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C -1 0 0 0 0 0 0 0 0 0 0 0", builder, 1); assertThat(atom.getMassNumber(), is(11)); }
@Test public void charge_dication() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 2 0 0 0 0 0 0 0 0 0 0", builder, 1); assertThat(atom.getFormalCharge(), is(2)); }
@Test public void readCoordinates() throws Exception { IAtom atom = reader.readAtomFast(" 7.8089 -1.3194 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0", builder, 1); assertThat(atom.getPoint3d().x, is(closeTo(7.8089, 0.5))); assertThat(atom.getPoint3d().y, is(closeTo(-1.3194, 0.5))); assertThat(atom.getPoint3d().z, is(closeTo(0.0d, 0.5))); }