@Test public void shouldHaveCorrectColumnWidths() throws Exception { double[] widths = table.getColumnWidths(); assertEquals(1.0 / 13, widths[0], 0.0001); assertEquals(13, widths.length); }
@Test public void tableShouldHaveCorrectColumnLengthAndFirstRowShouldSpanEntireLength() throws Exception { assertEquals(13, table.getRows()[0].getCells()[0].getColumnWidth()); }
private void rowsShouldHaveCorrectColors(int expRed, int expGreen, int expBlue, int index) { BackgroundColor color = table.getRows()[index].getCells()[0].getBackgroundColor(); assertEquals(expRed, color.getRedChannel()); assertEquals(expGreen, color.getGreenChannel()); assertEquals(expBlue, color.getBlueChannel()); }
@Test public void shouldHaveCorrectNumberOfRows() throws Exception { assertEquals(7, table.getRows().length); }
private void shouldHaveCorrectFirstColumnText(String expectedString, int index) { PdfTableRow row = table.getRows()[index]; assertEquals(expectedString, row.getCells()[0].getCellText()); }