Esempio n. 1
0
        public void DropDownListRenderer_AppendElement_ForEachOptionInFormPropertyOptionRendererShouldBeCalled()
        {
            var dropDownList = new DropDownList
            {
                Options =
                    new List<FormListOption> { new FormListOption(), new FormListOption(), new FormListOption() }
            };

            _dropDownListRenderer.AppendElement(dropDownList, null, FormRenderingType.Bootstrap2);

            A.CallTo(() => _dropDownListOptionRenderer.GetOption(A<FormListOption>.Ignored, null))
             .MustHaveHappened(Repeated.Exactly.Times(3));
        }
Esempio n. 2
0
        public void DropDownListRenderer_AppendElement_ForEachOptionInFormPropertyAppendsToInnerHtml()
        {
            var dropDownList = new DropDownList
            {
                Options =
                    new List<FormListOption> { new FormListOption()}
            };

            A.CallTo(() => _dropDownListOptionRenderer.GetOption(A<FormListOption>.Ignored, null))
             .Returns(new TagBuilder("option"));
            var appendElement = _dropDownListRenderer.AppendElement(dropDownList, null, FormRenderingType.Bootstrap2);

            appendElement.InnerHtml.Should().Be("<option></option>");
        }