예제 #1
0
        public void RenderEnforcedWidthCell()
        {
            Column.EnforceWidth = true;
            Column.Width        = new Unit(40, UnitType.Pixel);

            IBocColumnRenderer renderer = new BocCompoundColumnQuirksModeRenderer(new FakeResourceUrlFactory(), _bocListQuirksModeCssClassDefinition);

            renderer.RenderDataCell(_renderingContext, 0, false, EventArgs);
            var document = Html.GetResultDocument();

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

            Html.AssertAttribute(td, "class", _bocListQuirksModeCssClassDefinition.DataCellOdd);

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

            Html.AssertAttribute(cropSpan, "title", "referencedObject1");
            Html.AssertStyleAttribute(cropSpan, "width", "40px");
            Html.AssertStyleAttribute(cropSpan, "display", "block");
            Html.AssertStyleAttribute(cropSpan, "overflow", "hidden");
            Html.AssertStyleAttribute(cropSpan, "white-space", "nowrap");

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

            Html.AssertAttribute(span, "class", _bocListQuirksModeCssClassDefinition.Content);

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

            Html.AssertTextNode(textWrapper, "referencedObject1", 0);
        }
예제 #2
0
        public void RenderBasicCell()
        {
            IBocColumnRenderer renderer = new BocCompoundColumnQuirksModeRenderer(new FakeResourceUrlFactory(), _bocListQuirksModeCssClassDefinition);

            renderer.RenderDataCell(_renderingContext, 0, false, EventArgs);
            var document = Html.GetResultDocument();

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

            Html.AssertAttribute(td, "class", _bocListQuirksModeCssClassDefinition.DataCellOdd);

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

            Html.AssertAttribute(span, "class", _bocListQuirksModeCssClassDefinition.Content);

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

            Html.AssertTextNode(textWrapper, "referencedObject1", 0);
        }
예제 #3
0
        public void RenderEmptyCell()
        {
            Column.FormatString = string.Empty;

            IBocColumnRenderer renderer = new BocCompoundColumnQuirksModeRenderer(new FakeResourceUrlFactory(), _bocListQuirksModeCssClassDefinition);

            renderer.RenderDataCell(_renderingContext, 0, false, EventArgs);
            var document = Html.GetResultDocument();

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

            Html.AssertAttribute(td, "class", _bocListQuirksModeCssClassDefinition.DataCellOdd);

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

            Html.AssertAttribute(span, "class", _bocListQuirksModeCssClassDefinition.Content);

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

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