Exemple #1
0
        public void TestDiagnosticMetadataRenderingInTitleCell()
        {
            List.Stub(mock => mock.Index).Return(RowIndex.InitialOrder);
            List.Stub(mock => mock.IndexColumnTitle).Return("My_IndexColumn");

            IBocIndexColumnRenderer renderer = new BocIndexColumnRenderer(RenderingFeatures.WithDiagnosticMetadata, _bocListCssClassDefinition);

            renderer.RenderTitleCell(new BocListRenderingContext(HttpContext, Html.Writer, List, new BocColumnRenderer[0]));

            var document = Html.GetResultDocument();
            var th       = Html.GetAssertedChildElement(document, "th", 0);

            Html.AssertAttribute(th, DiagnosticMetadataAttributes.Content, "My_IndexColumn");
            Html.AssertAttribute(th, DiagnosticMetadataAttributesForObjectBinding.BocListCellIndex, 1.ToString());
        }
Exemple #2
0
        public void RenderIndexTitleCell()
        {
            List.Stub(mock => mock.Index).Return(RowIndex.InitialOrder);

            IBocIndexColumnRenderer renderer = new BocIndexColumnRenderer(RenderingFeatures.Default, _bocListCssClassDefinition);

            renderer.RenderTitleCell(new BocListRenderingContext(HttpContext, Html.Writer, List, new BocColumnRenderer[0]));

            var document = Html.GetResultDocument();

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

            Html.AssertAttribute(th, "class", _bocListCssClassDefinition.TitleCell, HtmlHelperBase.AttributeValueCompareMode.Contains);
            Html.AssertAttribute(th, "class", _bocListCssClassDefinition.TitleCellIndex, HtmlHelperBase.AttributeValueCompareMode.Contains);

            var span = Html.GetAssertedChildElement(th, "span", 0);

            Html.AssertTextNode(span, "No.", 0);
        }