示例#1
0
        public void null_values_are_propagated()
        {
            var customer = new Customer();
            var textbox  = XHtml.TextBox(() => customer.FirstName);

            textbox.Value.ShouldBeNull();
        }
示例#2
0
        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);
        }
示例#3
0
        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");
        }
示例#4
0
        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);
        }
示例#5
0
 public void a_value_type_property_is_identified_correctly()
 {
     XHtml.TextBox <Customer>(c => c.DateOfBirth.Day)
     .Name
     .ShouldBe("Customer.DateOfBirth.Day");
 }
示例#6
0
 public void a_reference_type_property_is_identified_correctly()
 {
     XHtml.TextBox <Customer>(c => c.FirstName)
     .Name
     .ShouldBe("Customer.FirstName");
 }