public void End_section()
        {
            var t = new DefaultFormTemplate();

            var result = t.EndSection();

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Begin_form_with_enctype()
        {
            var t = new DefaultFormTemplate();

            var result = t.BeginForm("/", FormMethod.Post, new HtmlAttributes(data_attr => "value"), EncType.Multipart);

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Begin_section()
        {
            var t = new DefaultFormTemplate();

            var result = t.BeginSection(new HtmlString("Section Title"), new HtmlString("<p>hello</p>"), new { @class = "asdf" }.ToHtmlAttributes());

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Begin_form_without_enctype()
        {
            var t = new DefaultFormTemplate();

            var result = t.BeginForm("/", FormMethod.Post, null, null);

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
示例#5
0
        public void Construct_form_via_extension_method()
        {
            var t = new DefaultFormTemplate();

            var f2 = _h.BeginChameleonForm(Action, Method, new HtmlAttributes(), Enctype);

            Assert.That(f2, Is.Not.Null);
            _h.ViewContext.Writer.Received().Write(Arg.Is<IHtmlString>(h => h.ToHtmlString() == t.BeginForm(Action, Method, _htmlAttributes, Enctype).ToHtmlString()));
        }
        public void Output_begin_failure_message()
        {
            var t = new DefaultFormTemplate();

            var result = t.BeginMessage(MessageType.Failure, new HtmlString("Heading"));

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Output_message_paragraph()
        {
            var t = new DefaultFormTemplate();

            var result = t.MessageParagraph(new HtmlString("<strong>asdf</strong>"));

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Output_field_with_prepended_and_appended_html()
        {
            var t = new DefaultFormTemplate();

            var result = t.Field(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), null, new FieldConfiguration()
                .Prepend(new HtmlString("<1>")).Prepend(new HtmlString("<2>"))
                .Append(new HtmlString("<3>")).Append(new HtmlString("<4>"))
                .ToReadonly(),
                false
            );

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Output_field_with_hint()
        {
            var t = new DefaultFormTemplate();

            var result = t.Field(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), null, new FieldConfiguration().WithHint("hello").ToReadonly(), false);

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Output_field()
        {
            var t = new DefaultFormTemplate();

            var result = t.Field(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), null, null, false);

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Output_end_navigation()
        {
            var t = new DefaultFormTemplate();

            var result = t.EndNavigation();

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
示例#12
0
 static FormTemplate()
 {
     Default = new DefaultFormTemplate();
 }