コード例 #1
0
        public void RenderTitlesRow()
        {
            IBocRowRenderer renderer = new BocRowQuirksModeRenderer(
                _bocListQuirksModeCssClassDefinition,
                new BocIndexColumnQuirksModeRenderer(_bocListQuirksModeCssClassDefinition),
                new BocSelectorColumnQuirksModeRenderer(_bocListQuirksModeCssClassDefinition));

            renderer.RenderTitlesRow(new BocListRenderingContext(HttpContext, Html.Writer, List, _bocColumnRenderers)); //use StubServiceLocator !??

            var document = Html.GetResultDocument();

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

            Html.GetAssertedChildElement(tr, "th", 0);
        }
コード例 #2
0
        public void RenderTitlesRowWithSelector()
        {
            List.Stub(mock => mock.IsSelectionEnabled).Return(true);
            List.Stub(mock => mock.Selection).Return(RowSelection.Multiple);

            IBocRowRenderer renderer = new BocRowQuirksModeRenderer(
                _bocListQuirksModeCssClassDefinition,
                new BocIndexColumnQuirksModeRenderer(_bocListQuirksModeCssClassDefinition),
                new BocSelectorColumnQuirksModeRenderer(_bocListQuirksModeCssClassDefinition));

            renderer.RenderTitlesRow(new BocListRenderingContext(HttpContext, Html.Writer, List, _bocColumnRenderers)); //use StubServiceLocator !??


            var document = Html.GetResultDocument();

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

            Html.GetAssertedChildElement(tr, "th", 0);

            Html.GetAssertedChildElement(tr, "th", 1);
        }
コード例 #3
0
        public void RenderTitlesRowWithIndex()
        {
            List.Stub(mock => mock.IsIndexEnabled).Return(true);
            List.Stub(mock => mock.Index).Return(RowIndex.InitialOrder);

            IBocRowRenderer renderer = new BocRowQuirksModeRenderer(
                _bocListQuirksModeCssClassDefinition,
                new BocIndexColumnQuirksModeRenderer(_bocListQuirksModeCssClassDefinition),
                new BocSelectorColumnQuirksModeRenderer(_bocListQuirksModeCssClassDefinition));

            renderer.RenderTitlesRow(new BocListRenderingContext(HttpContext, Html.Writer, List, _bocColumnRenderers)); //use StubServiceLocator !??

            var document = Html.GetResultDocument();

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

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

            Html.AssertAttribute(thIndex, "class", _bocListQuirksModeCssClassDefinition.TitleCell, HtmlHelperBase.AttributeValueCompareMode.Contains);
            Html.AssertAttribute(thIndex, "class", _bocListQuirksModeCssClassDefinition.TitleCellIndex, HtmlHelperBase.AttributeValueCompareMode.Contains);

            Html.GetAssertedChildElement(tr, "th", 1);
        }