private void CheckRendering(string value, string iconUrl, string description)
        {
            var resourceUrlFactory = new FakeResourceUrlFactory();

            _renderer = new BocBooleanValueRenderer(resourceUrlFactory, GlobalizationService, RenderingFeatures.Default, new BocBooleanValueResourceSetFactory(resourceUrlFactory));
            _renderer.Render(new BocBooleanValueRenderingContext(HttpContext, Html.Writer, _booleanValue));
            var document  = Html.GetResultDocument();
            var outerSpan = Html.GetAssertedChildElement(document, "span", 0);

            CheckOuterSpanAttributes(outerSpan);

            if (!_booleanValue.IsReadOnly)
            {
                CheckHiddenField(outerSpan, value);
            }
            else
            {
                CheckDataValueField(outerSpan, value);
            }
            Html.AssertChildElementCount(outerSpan, 3);

            var link = Html.GetAssertedChildElement(outerSpan, "a", 1);

            Html.AssertAttribute(link, "id", c_displayValueName);
            if (!_booleanValue.IsReadOnly)
            {
                CheckLinkAttributes(link);
            }

            var image = Html.GetAssertedChildElement(link, "img", 0);

            checkImageAttributes(image, iconUrl, description);

            var label = Html.GetAssertedChildElement(outerSpan, "span", 2);

            Html.AssertChildElementCount(label, 0);
            Html.AssertTextNode(label, description, 0);

            if (!_booleanValue.IsReadOnly)
            {
                Html.AssertAttribute(label, "onclick", _booleanValue.Enabled ? _clickScript : _dummyScript);
            }
        }
        public void RenderDiagnosticMetadataAttributes()
        {
            _booleanValue.Stub(mock => mock.IsRequired).Return(false);
            _booleanValue.Stub(mock => mock.IsAutoPostBackEnabled).Return(true);
            _booleanValue.Value = true;

            var resourceUrlFactory = new FakeResourceUrlFactory();

            _renderer = new BocBooleanValueRenderer(
                resourceUrlFactory,
                GlobalizationService,
                RenderingFeatures.WithDiagnosticMetadata,
                new BocBooleanValueResourceSetFactory(resourceUrlFactory));
            _renderer.Render(new BocBooleanValueRenderingContext(HttpContext, Html.Writer, _booleanValue));

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

            Html.AssertAttribute(outerSpan, DiagnosticMetadataAttributes.ControlType, "BocBooleanValue");
            Html.AssertAttribute(outerSpan, DiagnosticMetadataAttributes.TriggersPostBack, "true");
            Html.AssertAttribute(outerSpan, DiagnosticMetadataAttributesForObjectBinding.BocBooleanValueIsTriState, "true");
        }