Hi,
As developers of Catel we also provide a FluentValidation extension. Now one of my workitems for today was to upgrade FluentValidation to 4.0, but then one of our unit tests failed.
After a bit of puzzling, it seems like this is no longer giving an error when the strings are null:
As developers of Catel we also provide a FluentValidation extension. Now one of my workitems for today was to upgrade FluentValidation to 4.0, but then one of our unit tests failed.
After a bit of puzzling, it seems like this is no longer giving an error when the strings are null:
RuleFor(model => model.PersonFirstName).Length(3, 20);
RuleFor(model => model.PersonLastName).Length(3, 20);
Now I have to do it like this: RuleFor(model => model.PersonFirstName).NotNull().Length(3, 20);
RuleFor(model => model.PersonLastName).NotNull().Length(3, 20);
But can you explain to my how a string, which is null, which has 0 or an undefined number of characters can succeed for a length test of a length between 3 and 20?