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); }