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 null_values_are_propagated()
        {
            var customer = new Customer();
            var textbox = XHtml.TextBox(() => customer.FirstName);

            textbox.Value.ShouldBeNull();
        }
        public void nested_properties_are_generated()
        {
            var customer = new Customer { DateOfBirth = DateTime.Parse("14 Nov 2000") };
            var pp = new PropertyPathForInstance<int>(() => customer.DateOfBirth.Day);

            pp.Path.TypePrefix.ShouldBe("Customer");
            pp.Path.TypeSuffix.ShouldBe("DateOfBirth.Day");
            pp.PropertyType.ShouldBe<int>();
            pp.Value.ShouldBe(14);
        }
        public void the_class_without_namespace_is_generated()
        {
            var customer = new Customer { Username = "******" };
            var pp = new PropertyPathForInstance<object>(
                () => customer.Username);

            pp.Path.TypePrefix.ShouldBe("Customer");
            pp.Path.TypeSuffix.ShouldBe("Username");
            pp.PropertyType.ShouldBe<string>();
            pp.Value.ShouldBe("johndoe");
        }
        public void the_correct_html_fragment_is_generated()
        {
            var customer = new Customer {FirstName = "John"};
            var textbox = XHtml.TextBox(() => customer.FirstName);

            textbox.OuterXml
                .ShouldContain("<input")
                .ShouldContain("type=\"text\"")
                .ShouldContain("value=\"John\"")
                .ShouldContain("name=\"Customer.FirstName\"")
                .ShouldContain("/>");
        }
 public when_generating_paths_for_instances()
 {
     Customer = new Customer { FirstName = "John" };
 }
 public OperationResult Post(Customer customer) { return null; }