ContentElement implements OdsElement { public TableCellStyle addChildCellStyle(final TableCellStyle style, final CellType type) { final TableCellStyle newStyle; final DataStyle dataStyle = this.format.getDataStyle(type); if (dataStyle == null) { newStyle = style; } else { newStyle = this.stylesContainer.addChildCellStyle(style, dataStyle); } return newStyle; } ContentElement(final PositionUtil positionUtil, final XMLUtil xmlUtil,
                   final WriteUtil writeUtil, final DataStyles format,
                   final boolean libreOfficeMode, final StylesContainerImpl stylesContainer,
                   final Map<String, String> additionalNamespaceByPrefix); TableCellStyle addChildCellStyle(final TableCellStyle style, final CellType type); @Deprecated Table addTable(final String name, final int rowCapacity, final int columnCapacity); boolean addTable(final Table table); Table createTable(final String name, final int rowCapacity, final int columnCapacity); Table getLastTable(); StylesContainer getStyleTagsContainer(); Table getTable(final int tableIndex); Table getTable(final String name); int getTableCount(); List<Table> getTables(); @Override void write(final XMLUtil util, final ZipUTF8Writer writer); void writePreamble(final XMLUtil util, final ZipUTF8Writer writer); void writePostamble(final XMLUtil util, final ZipUTF8Writer writer); void writeEvents(final XMLUtil util, final ZipUTF8Writer writer); void addAutoFilter(final AutoFilter autoFilter); void addEvents(final ScriptEventListener... events); void addPilotTable(final PilotTable pilotTable);  }
@Test public void testAddChildCellStyle() { final TableCellStyle style = PowerMock.createNiceMock(TableCellStyle.class); PowerMock.resetAll(); EasyMock.expect(this.container.addChildCellStyle(TableCellStyle.DEFAULT_CELL_STYLE, this.format.getBooleanDataStyle())).andReturn(style); PowerMock.replayAll(); final TableCellStyle actual = this.content.addChildCellStyle(TableCellStyle.DEFAULT_CELL_STYLE, CellType.BOOLEAN); PowerMock.verifyAll(); Assert.assertEquals(style, actual); }
@Test public void testAddChildCellStyleOfTypeString() { PowerMock.resetAll(); PowerMock.replayAll(); final TableCellStyle actual = this.content.addChildCellStyle(TableCellStyle.DEFAULT_CELL_STYLE, CellType.STRING); PowerMock.verifyAll(); Assert.assertEquals(TableCellStyle.DEFAULT_CELL_STYLE, actual); }
@Test public void testAddChildCellStyleOfTypeVoid() { PowerMock.resetAll(); PowerMock.replayAll(); final TableCellStyle actual = this.content.addChildCellStyle(TableCellStyle.DEFAULT_CELL_STYLE, CellType.VOID); PowerMock.verifyAll(); Assert.assertEquals(TableCellStyle.DEFAULT_CELL_STYLE, actual); }