public Defects Validate(FileModel file, List <YearlyData> records) { Defects defects = new Defects { FileName = file.Name }; if (records == null || !records.Any()) { defects.Errors.Add("No data found in file."); return(defects); } YearValidator yearValidator = new YearValidator(defects); foreach (var record in records) { defects = yearValidator.Validate(record); } ProductNameValidator productNameValidator = new ProductNameValidator(defects); foreach (var record in records) { defects = productNameValidator.Validate(record); } defects = new ProductName().FindDifferentCasing(defects, records); return(defects); }
protected override bool ValidateDate(int year, int month, int day) { return(DayValidator.ValidDay(day, month, year) && MonthValidator.ValidMonth(month) && YearValidator.ValidYear(year)); }
public void Setup() { _sut = new YearValidator(); }
public void Setup() { _target = new YearValidator(new Defects()); }