public override bool IsValid(PlateInfo plateInfo) { if (plateInfo.CustomerType != CustomerType.Diplomat && !IsNormalPlate(plateInfo.Plate)) { return(false); } return(ProcessNext(plateInfo)); }
protected bool ProcessNext(PlateInfo plateInfo) { if (_next == null) { return(true); } return(_next.IsValid(plateInfo)); }
public override bool IsValid(PlateInfo plateInfo) { if (plateInfo.CustomerType != CustomerType.Advertisment && plateInfo.Plate.StartsWith("MLB")) { return(false); } return(ProcessNext(plateInfo)); }
public override bool IsValid(PlateInfo plateInfo) { if (plateInfo.CustomerType != CustomerType.Taxi && plateInfo.Plate.Last() == 'T') { return(false); } return(ProcessNext(plateInfo)); }
public override bool IsValid(PlateInfo plateInfo) { if (plateInfo.CustomerType == CustomerType.Diplomat) { return(Regex.IsMatch(plateInfo.Plate, "[A-Z]{2} \\d\\d\\d [A-Z]")); } return(ProcessNext(plateInfo)); }
// Question: should this method be in this class? If no: where? private bool IsValid(PlateInfo plateInfo) { var validator = BuildChain( new DiplomatValidator(), new NormalPlateValidator(), new ReservedForTaxiValidator(), new ReservedForAdvertismentValidator() ); return(validator.IsValid(plateInfo)); }
public abstract bool IsValid(PlateInfo plateInfo);