public AutoCompleteHtmlBuilderTests()
        {
            AutoComplete = AutoCompleteTestHelper.CreateAutocomplete();
            renderer     = new AutoCompleteHtmlBuilder(AutoComplete);

            AutoComplete.Name = "Test";
        }
        public AutoCompleteRenderingTests()
        {
            builder = new Mock <IAutoCompleteHtmlBuilder>();
            rootTag = new Mock <IHtmlNode>();
            rootTag.SetupGet(t => t.Children).Returns(() => new List <IHtmlNode>());

            AutoComplete      = AutoCompleteTestHelper.CreateAutocomplete();
            AutoComplete.Name = "Autocomplete";

            textWriter = new Mock <TextWriter>();
        }
        public void Should_serialize_client_events()
        {
            var Autocomplete = AutoCompleteTestHelper.CreateAutocomplete();

            Autocomplete.ClientEvents.OnDataBinding.CodeBlock       = Autocomplete.ClientEvents.OnDataBound.CodeBlock =
                Autocomplete.ClientEvents.OnError.CodeBlock         = Autocomplete.ClientEvents.OnLoad.CodeBlock =
                    Autocomplete.ClientEvents.OnChange.CodeBlock    = Autocomplete.ClientEvents.OnOpen.CodeBlock =
                        Autocomplete.ClientEvents.OnClose.CodeBlock = () => { };

            var writer = AutoCompleteTestHelper.clientSideObjectWriter;

            writer.Setup(w => w.AppendClientEvent("onLoad", It.IsAny <ClientEvent>()));
            writer.Setup(w => w.AppendClientEvent("onChange", It.IsAny <ClientEvent>()));
            writer.Setup(w => w.AppendClientEvent("onOpen", It.IsAny <ClientEvent>()));
            writer.Setup(w => w.AppendClientEvent("onClose", It.IsAny <ClientEvent>()));
            writer.Setup(w => w.AppendClientEvent("onDataBinding", It.IsAny <ClientEvent>()));
            writer.Setup(w => w.AppendClientEvent("onDataBound", It.IsAny <ClientEvent>()));
            writer.Setup(w => w.AppendClientEvent("onError", It.IsAny <ClientEvent>()));

            Autocomplete.WriteInitializationScript(textWriter.Object);

            writer.VerifyAll();
        }
 public AutoCompleteBuilderTests()
 {
     AutoComplete = AutoCompleteTestHelper.CreateAutocomplete();
     builder      = new AutoCompleteBuilder(AutoComplete);
 }