Exemple #1
0
        private void RenderAndAssertTable(out XmlNode tbody)
        {
            IBocListTableBlockRenderer renderer = new BocListTableBlockRenderer(_bocListCssClassDefinition, new StubRowRenderer());

            renderer.Render(new BocListRenderingContext(HttpContext, Html.Writer, List, _stubColumnRenderers));

            var document = Html.GetResultDocument();

            var tableContainer = Html.GetAssertedChildElement(document, "div", 0);

            Html.AssertAttribute(tableContainer, "class", _bocListCssClassDefinition.TableContainer);

            var tableScrollContainer = Html.GetAssertedChildElement(tableContainer, "div", 0);

            Html.AssertAttribute(tableScrollContainer, "class", _bocListCssClassDefinition.TableScrollContainer);

            var table = Html.GetAssertedChildElement(tableScrollContainer, "table", 0);

            Html.AssertAttribute(table, "class", _bocListCssClassDefinition.Table);

            var colgroup = Html.GetAssertedChildElement(table, "colgroup", 0);

            Html.GetAssertedChildElement(colgroup, "col", 0);
            Html.GetAssertedChildElement(colgroup, "col", 1);
            Html.GetAssertedChildElement(colgroup, "col", 2);

            var thead = Html.GetAssertedChildElement(table, "thead", 1);

            var trTitle = Html.GetAssertedChildElement(thead, "tr", 0);

            Html.AssertAttribute(trTitle, "class", "titleStub");

            tbody = Html.GetAssertedChildElement(table, "tbody", 2);
        }
Exemple #2
0
        public void RenderDummyTable()
        {
            Initialize(false);
            CommonInitialize();

            IBocListTableBlockRenderer renderer = new BocListTableBlockRenderer(_bocListCssClassDefinition, new StubRowRenderer());

            renderer.Render(new BocListRenderingContext(HttpContext, Html.Writer, List, _stubColumnRenderers));

            var document = Html.GetResultDocument();

            var table = Html.GetAssertedChildElement(document, "table", 0);
            var tr    = Html.GetAssertedChildElement(table, "tr", 0);
            var td    = Html.GetAssertedChildElement(tr, "td", 0);

            Html.AssertTextNode(td, HtmlHelper.WhiteSpace, 0);
        }