public void ColumnConfig() { ColumnsBuilder <TableEntity> columnsBuilder = new ColumnsBuilder <TableEntity>(null, null, null); ColumnsBuilder <TableEntity> actionBuilder = null; Dictionary <string, ColumnConfig> config = null; SortingConfig sortingConfig = null; _builderFactory.ColumnsBuilder <TableEntity>(Arg.Do <Dictionary <string, ColumnConfig> >(c => config = c), Arg.Do <SortingConfig>(c => sortingConfig = c)).Returns(columnsBuilder); TableBuilder <TableEntity> builder = _builder.Columns(fb => actionBuilder = fb); this.RenderAndVerify(); _builderFactory.Received(1).ColumnsBuilder <TableEntity>(Arg.Any <Dictionary <string, ColumnConfig> >(), Arg.Any <SortingConfig>()); actionBuilder.Should().BeSameAs(columnsBuilder); config.Should().BeSameAs(_config.Columns); sortingConfig.Should().BeSameAs(_config.Sorting); builder.Should().BeSameAs(_builder); }
/// <summary> /// Configures the columns of the table. /// </summary> /// <param name="configAction">Configuration action</param> /// <returns>The table builder instance.</returns> public MvcCoreBootstrapTableBuilder <T> Columns(Action <MvcCoreBootstrapTableColumnsBuilder <T> > configAction) { configAction(_builderFactory.ColumnsBuilder <T>(_config.Columns, _config.Sorting)); return(this); }
/// <summary> /// Configures the columns of the table. /// </summary> /// <param name="configAction">Configuration action</param> /// <returns>The table builder instance.</returns> public TableBuilder <T> Columns(Action <ColumnsBuilder <T> > configAction) { configAction(_builderFactory.ColumnsBuilder <T>(_config.Columns, _config.Sorting)); return(this); }