Ejemplo n.º 1
0
        public void ButtonExtensions()
        {
            var hh = new FakeHtmlHelper<Foo>();

            var html = hh.WButton("botao", "Label", true);
            Assert.AreEqual("<div class=\"wbutton-normal submit wbutton\" id=\"botao\" name=\"botao\">Label</div>", html.ToHtmlString());

            html = hh.WButton("botao", "Label", false);
            Assert.AreEqual("<div class=\"wbutton-normal wbutton\" id=\"botao\" name=\"botao\">Label</div>", html.ToHtmlString());

            html = hh.WButton("botao", "Label", "icone");
            Assert.AreEqual("<div class=\"wbutton-normal wbutton\" icon=\"icone\" id=\"botao\" name=\"botao\">Label</div>", html.ToHtmlString());

            html = hh.WButton("botao", "Label", "icone", true);
            Assert.AreEqual("<div class=\"wbutton-normal submit wbutton\" icon=\"icone\" id=\"botao\" name=\"botao\">Label</div>", html.ToHtmlString());

            html = hh.WButton("botao", "Label", WButtonType.Action);
            Assert.AreEqual("<div class=\"wbutton-action wbutton\" id=\"botao\" name=\"botao\">Label</div>", html.ToHtmlString());

            html = hh.WButton("botao", "Label", "icone", WButtonType.Alert);
            Assert.AreEqual("<div class=\"wbutton-alert wbutton\" icon=\"icone\" id=\"botao\" name=\"botao\">Label</div>", html.ToHtmlString());

            html = hh.WButton("botao", "Label");
            Assert.AreEqual("<div class=\"wbutton-normal wbutton\" id=\"botao\" name=\"botao\">Label</div>", html.ToHtmlString());

            html = hh.WButton("botao", "Label", new { @class = "abc", value = "123" });
            Assert.AreEqual("<div class=\"wbutton-normal wbutton abc\" id=\"botao\" name=\"botao\" value=\"123\">Label</div>", html.ToHtmlString());
        }