public void Output_submit_button_when_button_with_content_and_submit_type_specified() { var t = new TwitterBootstrap3FormTemplate(); var result = t.Button(new HtmlString("<strong>asdf</strong>"), "submit", "id", "value", new HtmlAttributes(@class => "asdf")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Begin_nested_section() { var t = new TwitterBootstrap3FormTemplate(); var result = t.BeginNestedSection(new HtmlString("Section Heading"), new HtmlString("<p>Hello</p>"), new { @class = "asdf" }.ToHtmlAttributes()); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_button_input_when_button_with_no_content_specified() { var t = new TwitterBootstrap3FormTemplate(); var result = t.Button(null, null, null, "value", null); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_end_field() { var t = new TwitterBootstrap3FormTemplate(); var result = t.EndField(); 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_begin_field() { var t = new TwitterBootstrap3FormTemplate(); var result = t.BeginField(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), null, new FieldConfiguration(), false); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Begin_form_with_enctype() { var t = new TwitterBootstrap3FormTemplate(); var result = t.BeginForm("/", FormMethod.Post, new HtmlAttributes(data_attr => "value"), EncType.Multipart); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_begin_navigation() { var t = new TwitterBootstrap3FormTemplate(); var result = t.BeginNavigation(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_button_when_button_with_content_specified() { var t = new TwitterBootstrap3FormTemplate(); var result = t.Button(new HtmlString("<strong>asdf</strong>"), null, null, null, null); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void End_nested_section() { var t = new TwitterBootstrap3FormTemplate(); var result = t.EndNestedSection(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_message_paragraph() { var t = new TwitterBootstrap3FormTemplate(); var result = t.MessageParagraph(new HtmlString("<strong>asdf</strong>")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Begin_nested_section_without_leading_html_or_heading() { var t = new TwitterBootstrap3FormTemplate(); var result = t.BeginNestedSection(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_begin_failure_message() { var t = new TwitterBootstrap3FormTemplate(); var result = t.BeginMessage(MessageType.Failure, new HtmlString("Heading")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_begin_information_message_without_heading() { var t = new TwitterBootstrap3FormTemplate(); var result = t.BeginMessage(MessageType.Information, new HtmlString("")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Begin_form_without_enctype() { var t = new TwitterBootstrap3FormTemplate(); var result = t.BeginForm("/", FormMethod.Post, null, null); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
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 Render_checkbox_list() { var t = new TwitterBootstrap3FormTemplate(); var result = t.RadioOrCheckboxList(new IHtmlContent[] { new HtmlString("1"), new HtmlString("2") }, true); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_submit_button_with_non_default_style_or_size() { var t = new TwitterBootstrap3FormTemplate(); var result = new ButtonHtmlAttributes(h => t.Button(new HtmlString("content"), "submit", null, null, h)) .WithStyle(EmphasisStyle.Danger) .WithSize(ButtonSize.Large) .WithIcon("star"); 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()); }