public void Should_apply_header_html_attributes()
        {
            const string key = "foo";
            const string value = "bar";

            var footerAttributes = new Dictionary<string, object> {{key, value}};

            var cell = new GridFooterCellBuilder(footerAttributes, new HtmlTemplate<GridAggregateResult>()).CreateCell();

            cell.Attribute(key).ShouldEqual(value);
        }
        public void Should_render_column_footer_template_if_declared()
        {
            const string expectedContent = "template content";

            var template = new HtmlTemplate<GridAggregateResult>
                               {
                                   Html = expectedContent
                               };

            var cell = new GridFooterCellBuilder(new Dictionary<string, object>(), template).CreateCell();

            cell.InnerHtml.ShouldEqual(expectedContent);
        }
        public void Should_render_column_footer_template_if_declared()
        {
            const string expectedContent = "template content";

            var template = new HtmlTemplate <GridAggregateResult>
            {
                Html = expectedContent
            };

            var cell = new GridFooterCellBuilder(new Dictionary <string, object>(), template).CreateCell();

            cell.InnerHtml.ShouldEqual(expectedContent);
        }
        public void Should_apply_header_html_attributes()
        {
            const string key   = "foo";
            const string value = "bar";

            var footerAttributes = new Dictionary <string, object> {
                { key, value }
            };

            var cell = new GridFooterCellBuilder(footerAttributes, new HtmlTemplate <GridAggregateResult>()).CreateCell();

            cell.Attribute(key).ShouldEqual(value);
        }
        public void Should_pass_aggregate_result_to_template_if_exists()
        {
            var expectedResult = new GridAggregateResult(new AggregateResult[0]);

            GridAggregateResult result = null;
            var template = new HtmlTemplate<GridAggregateResult>
            {
                InlineTemplate = arg => result = arg
            };

            var cellBuilder = new GridFooterCellBuilder(new Dictionary<string, object>(), template)
            {
                AggregateResults = expectedResult
            };

            cellBuilder.CreateCell().ToString();

            result.ShouldBeSameAs(expectedResult);
        }
        public void Should_pass_aggregate_result_to_template_if_exists()
        {
            var expectedResult = new GridAggregateResult(new AggregateResult[0]);

            GridAggregateResult result = null;
            var template = new HtmlTemplate <GridAggregateResult>
            {
                InlineTemplate = arg => result = arg
            };

            var cellBuilder = new GridFooterCellBuilder(new Dictionary <string, object>(), template)
            {
                AggregateResults = expectedResult
            };

            cellBuilder.CreateCell().ToString();

            result.ShouldBeSameAs(expectedResult);
        }
 public GridFooterCellBuilderTests()
 {
     builder = new GridFooterCellBuilder(new Dictionary<string, object>(), new HtmlTemplate<GridAggregateResult>());
 }
 public GridFooterCellBuilderTests()
 {
     builder = new GridFooterCellBuilder(new Dictionary <string, object>(), new HtmlTemplate <GridAggregateResult>());
 }