public void null_values_are_propagated() { var customer = new Customer(); var textbox = XHtml.TextBox(() => customer.FirstName); textbox.Value.ShouldBeNull(); }
public void the_property_type_is_set_to_text() { var customer = (new Customer { FirstName = "John" }); var textbox = XHtml.TextBox(() => customer.FirstName); textbox.Type.ShouldBe(InputType.Text); }
public void the_property_name_is_written_correctly() { var customer = new Customer { FirstName = "John" }; var textbox = XHtml.TextBox(() => customer.FirstName); textbox.Name.ShouldBe("Customer.FirstName"); }
public void the_correct_html_fragment_is_generated() { var customer = new Customer { FirstName = "John" }; var textbox = XHtml.TextBox(() => customer.FirstName); textbox.OuterXml.ShouldContain("<input", Case.Sensitive); textbox.OuterXml.ShouldContain("type=\"text\"", Case.Sensitive); textbox.OuterXml.ShouldContain("value=\"John\"", Case.Sensitive); textbox.OuterXml.ShouldContain("name=\"Customer.FirstName\"", Case.Sensitive); textbox.OuterXml.ShouldContain("/>", Case.Sensitive); }
public void a_value_type_property_is_identified_correctly() { XHtml.TextBox <Customer>(c => c.DateOfBirth.Day) .Name .ShouldBe("Customer.DateOfBirth.Day"); }
public void a_reference_type_property_is_identified_correctly() { XHtml.TextBox <Customer>(c => c.FirstName) .Name .ShouldBe("Customer.FirstName"); }