public void Output_field_with_hint()
        {
            var t = new TwitterBootstrapFormTemplate();

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

            var result = t.Field(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), null, new FieldConfiguration().AddFieldContainerClass("a-container-class-1").AddFieldContainerClass("a-container-class-2").ToReadonly(), false);

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

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

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

            var result = t.Field(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), null, new FieldConfiguration().AddFieldContainerClass("a-container-class-1").AddFieldContainerClass("a-container-class-2"), false);

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

            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>"))
                                 .WithHint(new HtmlString("<hint>")),
                                 false
                                 );

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

            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>"))
                .WithHint(new HtmlString("<hint>")),
                false
            );

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Output_field_with_prepended_and_appended_html_when_required()
        {
            var t        = new TwitterBootstrapFormTemplate();
            var metadata = new ModelMetadata(new EmptyModelMetadataProvider(), typeof(object), () => null, typeof(object), "");

            metadata.IsRequired = true;

            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>"))
                                 .WithHint(new HtmlString("<hint>")),
                                 false
                                 );

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Output_field_with_prepended_and_appended_html_when_input_group()
        {
            var t = new TwitterBootstrapFormTemplate();
            var metadata = new ModelMetadata(new EmptyModelMetadataProvider(), typeof(object), () => null, typeof(object), "");
            metadata.IsRequired = true;

            var result = t.Field(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), metadata, new FieldConfiguration()
                .Prepend(new HtmlString("<1>")).Prepend(new HtmlString("<2>"))
                .Append(new HtmlString("<3>")).Append(new HtmlString("<4>"))
                .WithHint(new HtmlString("<hint>"))
                .AsInputGroup(), // This shouldn't take effect since we haven't specified this field can be an input group
                false
            );

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Output_field_with_prepended_and_appended_html_when_input_group()
        {
            var t        = new TwitterBootstrapFormTemplate();
            var metadata = new ModelMetadata(new EmptyModelMetadataProvider(), typeof(object), () => null, typeof(object), "");

            metadata.IsRequired = true;

            var result = t.Field(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), metadata, new FieldConfiguration()
                                 .Prepend(new HtmlString("<1>")).Prepend(new HtmlString("<2>"))
                                 .Append(new HtmlString("<3>")).Append(new HtmlString("<4>"))
                                 .WithHint(new HtmlString("<hint>"))
                                 .AsInputGroup(), // This shouldn't take effect since we haven't specified this field can be an input group
                                 false
                                 );

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }
        public void Output_checkbox_field_with_prepended_and_appended_html_when_required()
        {
            var t = new TwitterBootstrapFormTemplate();
            var fc = new FieldConfiguration();
            fc.Bag.IsCheckboxControl = true;
            var metadata = new ModelMetadata(new EmptyModelMetadataProvider(), typeof(object), () => null, typeof(object), "");
            metadata.IsRequired = true;

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

            HtmlApprovals.VerifyHtml(result.ToHtmlString());
        }