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

            var result = t.EndNestedSection();

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

            var result = t.EndForm();

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

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

            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_form_without_enctype()
        {
            var t = new DefaultFormTemplate();

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

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        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<Nancy.ViewEngines.Razor.IHtmlString>(h => h.ToHtmlString() == t.BeginForm(Action, Method, _htmlAttributes, Enctype).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_message_paragraph()
        {
            var t = new DefaultFormTemplate();

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

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

            var result = t.EndMessage();

            HtmlApprovals.VerifyHtml(result.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_begin_navigation()
        {
            var t = new DefaultFormTemplate();

            var result = t.BeginNavigation();

            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());
        }