public void Output_field_with_container_class() { var t = new DefaultFormTemplate(); 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 Use_correct_html_for_boolean_list_and_true_value() { var g = Arrange(m => m.RequiredBoolean, m => m.RequiredBoolean = true); var result = g.GetFieldHtml(new FieldConfiguration().AsRadioList()); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Use_correct_html_for_boolean_list_and_custom_labels() { var g = Arrange(m => m.RequiredBoolean); var result = g.GetFieldHtml(new FieldConfiguration().AsRadioList().WithTrueAs("True").WithFalseAs("False")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Use_correct_html_for_label_for_boolean_list_with_overridden_label() { var g = Arrange(m => m.RequiredNullableBoolean); var result = g.GetLabelHtml(new FieldConfiguration().AsRadioList().Label(new HtmlString("<strong>lol</strong>"))); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Use_correct_html_for_checked_single_checkbox_with_default_label() { var g = Arrange(m => m.RequiredBoolean, m => m.RequiredBoolean = true); var result = g.GetFieldHtml(default(IFieldConfiguration)); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void End_nested_section() { var t = new DefaultFormTemplate(); var result = t.EndNestedSection(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Use_correct_html_for_nullable_required_boolean_checkbox_with_no_value() { var g = Arrange(m => m.RequiredNullableBoolean); var result = g.GetFieldHtml(default(IFieldConfiguration)); 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_end_message() { var t = new DefaultFormTemplate(); var result = t.EndMessage(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_begin_navigation() { var t = new DefaultFormTemplate(); var result = t.BeginNavigation(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_begin_information_message_without_heading() { var t = new DefaultFormTemplate(); var result = t.BeginMessage(MessageType.Information, new HtmlString("")); 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 Output_begin_field() { var t = new DefaultFormTemplate(); var result = t.BeginField(new HtmlString("labelhtml"), new HtmlString("elementhtml"), new HtmlString("validationhtml"), null, new FieldConfiguration(), false); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_field_with_hint_id() { var t = new DefaultFormTemplate(); 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 Begin_nested_section_without_leading_html_or_heading() { var t = new DefaultFormTemplate(); var result = t.BeginNestedSection(); 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 Begin_nested_section() { var t = new DefaultFormTemplate(); 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 DefaultFormTemplate(); var result = t.Button(null, null, null, "value", null); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Use_correct_html_for_boolean_dropdown_list_and_false_value() { var g = Arrange(m => m.RequiredBoolean); var result = g.GetFieldHtml(new FieldConfiguration().AsDropDown()); 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 Use_correct_html_for_nullable_required_boolean_dropdown_with_no_value() { var g = Arrange(m => m.RequiredNullableBoolean); var result = g.GetFieldHtml(new FieldConfiguration().AsDropDown()); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_button_when_button_with_content_specified() { var t = new DefaultFormTemplate(); var result = t.Button(new HtmlString("<strong>asdf</strong>"), null, null, null, null); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Use_correct_html_for_label_for_boolean_checkbox() { var g = Arrange(m => m.RequiredNullableBoolean); var result = g.GetLabelHtml(new FieldConfiguration()); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_submit_button_when_button_with_content_and_submit_type_specified() { var t = new DefaultFormTemplate(); var result = t.Button(new HtmlString("<strong>asdf</strong>"), "submit", "id", "value", new HtmlAttributes(@class => "asdf")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Use_correct_html_for_single_checkbox_with_custom_label() { var g = Arrange(m => m.RequiredBoolean); var result = g.GetFieldHtml(new FieldConfiguration().InlineLabel("Some label")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Allow_for_name_to_be_specified_but_id_to_be_overwritten_when_creating_a_button() { var t = new DefaultFormTemplate(); var result = t.Button(new HtmlString("a"), null, "name", null, new HtmlAttributes().Attr("id", "asdf")); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Use_correct_html_for_optional_boolean_and_no_value() { var g = Arrange(m => m.OptionalBooleanField); var result = g.GetFieldHtml(new FieldConfiguration().AsDropDown()); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void End_form() { var t = new DefaultFormTemplate(); var result = t.EndForm(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Output_end_navigation() { var t = new TwitterBootstrapFormTemplate(); var result = t.EndNavigation(); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }
public void Use_correct_html_for_optional_enum_list_field() { var g = Arrange(m => m.OptionalEnumList); var result = g.GetFieldHtml(ExampleFieldConfiguration); HtmlApprovals.VerifyHtml(result.ToHtmlString()); }