public void Footer() { FooterBuilder footerBuilder = new FooterBuilder(null); FooterBuilder actionBuilder = null; FooterConfig config = null; _builderFactory.FooterBuilder(Arg.Do <FooterConfig>(fc => config = fc)).Returns(footerBuilder); TableBuilder <TableEntity> builder = _builder.Footer(fb => actionBuilder = fb); this.RenderAndVerify(); _builderFactory.Received(1).FooterBuilder(Arg.Any <FooterConfig>()); actionBuilder.Should().BeSameAs(footerBuilder); config.Should().BeSameAs(_config.Footer); builder.Should().BeSameAs(_builder); }
public void Filterable() { FilteringBuilder filteringBuilder = new FilteringBuilder(null); FilteringBuilder actionBuilder = null; FilteringConfig config = null; _builderFactory.FilteringBuilder(Arg.Do <FilteringConfig>(fc => config = fc)).Returns(filteringBuilder); ColumnBuilder builder = _builder.Filterable(fb => actionBuilder = fb); _builderFactory.Received(1).FilteringBuilder(Arg.Any <FilteringConfig>()); actionBuilder.Should().BeSameAs(filteringBuilder); config.Should().BeSameAs(_columnConfig.Filtering); builder.Should().BeSameAs(_builder); }
public void Cells() { CellsBuilder cellsBuilder = new CellsBuilder(null, null); CellsBuilder actionBuilder = null; Dictionary <string, CellConfig> config = null; _builderFactory.CellsBuilder(Arg.Do <Dictionary <string, CellConfig> >(fc => config = fc)) .Returns(cellsBuilder); RowBuilder <TableEntity> builder = _builder.Cells(fb => actionBuilder = fb); _builderFactory.Received(1).CellsBuilder(Arg.Any <Dictionary <string, CellConfig> >()); actionBuilder.Should().BeSameAs(cellsBuilder); _builder.Config.CellConfigs.Should().BeSameAs(config); builder.Should().BeSameAs(_builder); }
public void Cell() { CellBuilder configBuilder = new CellBuilder(null); CellConfig config = null; TableEntity entity = new TableEntity(); _builderFactory.CellBuilder(Arg.Do <CellConfig>(c => config = c)).Returns(configBuilder); CellBuilder builder = _builder.Cell(() => entity.Property); _builderFactory.Received(1).CellBuilder(Arg.Any <CellConfig>()); _configs.Should().HaveCount(1); _configs.Should().ContainKey("Property"); CellConfig cellConfig = _configs["Property"]; cellConfig.Should().BeSameAs(config); cellConfig.CssClasses.Should().BeEmpty(); cellConfig.State.Should().Be(ContextualState.Default); builder.Should().BeSameAs(configBuilder); }
public void Column() { ColumnBuilder configBuilder = new ColumnBuilder(null, null); ColumnConfig config = null; _builderFactory.ColumnBuilder(Arg.Do <ColumnConfig>(c => config = c)).Returns(configBuilder); ColumnBuilder builder = _builder.Column(entity => entity.Property); _builderFactory.Received(1).ColumnBuilder(Arg.Any <ColumnConfig>()); _columnConfigs.Should().HaveCount(1); _columnConfigs.Should().ContainKey("Property"); ColumnConfig columnConfig = _columnConfigs["Property"]; columnConfig.Should().BeSameAs(config); columnConfig.Visible.Should().BeTrue(); columnConfig.SortState.Should().BeNull(); columnConfig.CssClasses.Should().BeEmpty(); columnConfig.Header.Should().BeNull(); columnConfig.Filtering.Should().NotBeNull(); columnConfig.Filtering.Threshold.Should().Be(0); columnConfig.Filtering.CssClasses.Should().BeEmpty(); builder.Should().BeSameAs(configBuilder); }