public void End_nested_section() { var t = new TwitterBootstrapFormTemplate(); var result = t.EndNestedSection(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_begin_field() { var t = new TwitterBootstrapFormTemplate(); var result = t.BeginField(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), null, new FieldConfiguration().ToReadonly(), false); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Begin_nested_section() { var t = new TwitterBootstrapFormTemplate(); var result = t.BeginNestedSection(new HtmlString("Section Heading"), new HtmlString("<p>Hello</p>"), new { @class = "asdf" }.ToHtmlAttributes()); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Begin_nested_section_without_leading_html_or_heading() { var t = new TwitterBootstrapFormTemplate(); var result = t.BeginNestedSection(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void End_form() { var t = new TwitterBootstrapFormTemplate(); var result = t.EndForm(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Render_checkbox_list() { var t = new TwitterBootstrapFormTemplate(); var result = t.RadioOrCheckboxList(new IHtmlString[] { new HtmlString("1"), new HtmlString("2") }, true); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_submit_button_when_button_with_content_and_submit_type_specified() { var t = new TwitterBootstrapFormTemplate(); var result = t.Button(new HtmlString("<strong>asdf</strong>"), "submit", "id", "value", new HtmlAttributes(@class => "asdf")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_end_navigation() { var t = new TwitterBootstrapFormTemplate(); var result = t.EndNavigation(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Begin_form_with_enctype() { var t = new TwitterBootstrapFormTemplate(); var result = t.BeginForm("/", FormMethod.Post, new HtmlAttributes(data_attr => "value"), EncType.Multipart); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_message_paragraph() { var t = new TwitterBootstrapFormTemplate(); var result = t.MessageParagraph(new HtmlString("<strong>asdf</strong>")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_begin_failure_message() { var t = new TwitterBootstrapFormTemplate(); var result = t.BeginMessage(MessageType.Failure, new HtmlString("Heading")); 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").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_begin_information_message_without_heading() { var t = new TwitterBootstrapFormTemplate(); var result = t.BeginMessage(MessageType.Information, new HtmlString("")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_button_when_button_with_content_specified() { var t = new TwitterBootstrapFormTemplate(); var result = t.Button(new HtmlString("<strong>asdf</strong>"), null, null, null, null); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Begin_form_without_enctype() { var t = new TwitterBootstrapFormTemplate(); var result = t.BeginForm("/", FormMethod.Post, null, null); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_button_input_when_button_with_no_content_specified() { var t = new TwitterBootstrapFormTemplate(); var result = t.Button(null, null, null, "value", null); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_end_message() { var t = new TwitterBootstrapFormTemplate(); var result = t.EndMessage(); 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_begin_navigation() { var t = new TwitterBootstrapFormTemplate(); var result = t.BeginNavigation(); 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_submit_button_with_non_default_style_or_size() { var t = new TwitterBootstrapFormTemplate(); 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 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_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()); }
public void Output_begin_field() { var t = new TwitterBootstrapFormTemplate(); var result = t.BeginField(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), null, new FieldConfiguration(), false); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }