Day 4 was decent - I've been using FluentValidators a lot recently, so quite easy to use them here. Once you've got a passport object set up, you can write rules it's got to fulfil to be valid such as:
public class PassportDataValidator : AbstractValidator<PassportData>
{
public PassportDataValidator()
{
RuleFor(passport => passport.byr).InclusiveBetween(1920, 2002);
RuleFor(passport => passport.iyr).InclusiveBetween(2010, 2020);
}
}
Day 4 was decent - I've been using FluentValidators a lot recently, so quite easy to use them here. Once you've got a passport object set up, you can write rules it's got to fulfil to be valid such as: