schema.Should().Contain(c=>c.Order==1&&c.Name=="lastName"&&c.Label=="Last Name"&&c.HelpText=="Your Last Name"&&(string)c.Value=="Poop");
schema.Should().Contain(c=>c.Order==0&&c.Name=="firstName"&&c.Label=="First Name"&&c.HelpText=="Your First Name"&&(string)c.Value=="Bob");
schema.Should().Contain(c=>c.Order==1&&c.Name=="lastName"&&c.Label=="Last Name"&&c.HelpText=="Your Last Name"&&c.HelpTextWarning=="Mandatory Last Name"&&(string)c.Value=="Poop");
schema.Should().Contain(c=>c.Order==0&&c.Name=="firstName"&&c.Label=="First Name"&&c.HelpText=="Your First Name"&&c.HelpTextWarning=="Mandatory First Name"&&(string)c.Value=="Bob");
}
[Test]
publicvoidschema_should_have_nested_fields()
{
varmodel=newNestedTestModel
{
Name=
{
FirstName="Bob",
LastName="Poop"
}
};
varschema=SchemaBuilder.ToSchema(model);
schema.Should().Contain(c=>c.Order==0&&c.Name=="name.firstName"&&c.Label=="First Name"&&c.HelpText=="Your First Name"&&c.HelpTextWarning=="Mandatory First Name"&&(string)c.Value=="Bob");
schema.Should().Contain(c=>c.Order==1&&c.Name=="name.lastName"&&c.Label=="Last Name"&&c.HelpText=="Your Last Name"&&c.HelpTextWarning=="Mandatory Last Name"&&(string)c.Value=="Poop");