public void Output_field_with_container_class() { var t = new TwitterBootstrap3FormTemplate(); 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_hint_id() { var t = new TwitterBootstrap3FormTemplate(); var result = t.Field(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), null, new FieldConfiguration().WithHint("hello").WithHintId("HintId"), false); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_field_with_prepended_and_appended_html() { var t = new TwitterBootstrap3FormTemplate(); 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 TwitterBootstrap3FormTemplate(); var result = t.Field(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), GetRequiredMetadata(), 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_radio_list_field_with_prepended_and_appended_html_when_required() { var t = new TwitterBootstrap3FormTemplate(); var fc = new FieldConfiguration(); fc.Bag.IsRadioOrCheckboxList = true; var result = t.Field(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), GetRequiredMetadata(), fc .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()); }