コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
 public GridFooterCellBuilderTests()
 {
     builder = new GridFooterCellBuilder(new Dictionary<string, object>(), new HtmlTemplate<GridAggregateResult>());
 }
コード例 #8
0
 public GridFooterCellBuilderTests()
 {
     builder = new GridFooterCellBuilder(new Dictionary <string, object>(), new HtmlTemplate <GridAggregateResult>());
 }