private XmlNode GetAssertedDiv(int expectedChildElements, bool withStyle)
        {
            var renderer = new TestableBocAutoCompleteReferenceValueQuirksModeRenderer(_resourceUrlFactory, () => TextBox);

            Assert.That(TextBox.ID, Is.Null);
            renderer.Render(CreateRenderingContext());
            if (!Control.IsReadOnly)
            {
                Assert.That(TextBox.ID, Is.EqualTo(Control.GetTextValueName()));
            }

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

            div.AssertAttributeValueEquals("id", "MyReferenceValue");
            div.AssertAttributeValueContains("class", "bocAutoCompleteReferenceValue");
            if (Control.IsReadOnly)
            {
                div.AssertAttributeValueContains("class", "readOnly");
            }

            div.AssertStyleAttribute("display", "inline");
            if (withStyle)
            {
                div.AssertStyleAttribute("height", s_height.ToString());
                div.AssertStyleAttribute("width", s_width.ToString());
            }

            div.AssertChildElementCount(expectedChildElements);
            return(div);
        }
        public void RenderOptions()
        {
            var renderer = new TestableBocAutoCompleteReferenceValueQuirksModeRenderer(_resourceUrlFactory, () => new StubTextBox());

            Html.Writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            renderer.RenderOptionsMenuTitle(CreateRenderingContext());
            Html.Writer.RenderEndTag();

            var document = Html.GetResultDocument();

            AssertRow(document, false, false, false);
        }
        public void RenderOptionsReadOnlyWithStyle()
        {
            AddStyle();
            Control.Stub(stub => stub.IsReadOnly).Return(true);

            var renderer = new TestableBocAutoCompleteReferenceValueQuirksModeRenderer(_resourceUrlFactory);

            Html.Writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            renderer.RenderOptionsMenuTitle(CreateRenderingContext());
            Html.Writer.RenderEndTag();

            var document = Html.GetResultDocument();

            AssertRow(document, true, false, true);
        }