public void AddTableEle(TableEle tableEle, params string[] cols) { if (cols != null && cols.Length > 0) { StringBuilder th = new StringBuilder(""); ITableItemStrategy item = TableFactoryMethod.GetTableItem(tableEle); for (int i = 0; i < cols.Length; i++) { //### commented in order to render the cell regardless of null or empty string //if(!"".Equals(cols[i])){ th.Append("\n" + item.Middle.Replace("{value}", cols[i])); //} } if (!"".Equals(th.ToString())) { th.Insert(0, item.Top); th.Append(item.Bottom); } string finalResult = SetUpRepeatTableHeaderOnEveryPage(th); _txt.Append(finalResult); //final result appended } }
public void TestGetTableItem() { TableFactoryMethod instance = TableFactoryMethod.Instance; Assert.True(TableFactoryMethod.GetTableItem(TableEle.TABLE_DEF) is TableDefinition); Assert.True(TableFactoryMethod.GetTableItem(TableEle.TH) is TableHeader); Assert.True(TableFactoryMethod.GetTableItem(TableEle.TD) is TableCol); Assert.True(TableFactoryMethod.GetTableItem(TableEle.TF) is TableFooter); Assert.True(TableFactoryMethod.GetTableItem(TableEle.TD) is TableCol); Assert.Null(TableFactoryMethod.GetTableItem(null)); }
public void TestGetInstance() { TableFactoryMethod instance = TableFactoryMethod.Instance; Assert.NotNull(instance); }