Esempio n. 1
0
 public override bool IsValid(PlateInfo plateInfo)
 {
     if (plateInfo.CustomerType != CustomerType.Diplomat && !IsNormalPlate(plateInfo.Plate))
     {
         return(false);
     }
     return(ProcessNext(plateInfo));
 }
Esempio n. 2
0
 protected bool ProcessNext(PlateInfo plateInfo)
 {
     if (_next == null)
     {
         return(true);
     }
     return(_next.IsValid(plateInfo));
 }
Esempio n. 3
0
        public override bool IsValid(PlateInfo plateInfo)
        {
            if (plateInfo.CustomerType != CustomerType.Advertisment && plateInfo.Plate.StartsWith("MLB"))
            {
                return(false);
            }

            return(ProcessNext(plateInfo));
        }
Esempio n. 4
0
        public override bool IsValid(PlateInfo plateInfo)
        {
            if (plateInfo.CustomerType != CustomerType.Taxi && plateInfo.Plate.Last() == 'T')
            {
                return(false);
            }

            return(ProcessNext(plateInfo));
        }
Esempio n. 5
0
        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));
        }
Esempio n. 6
0
        // 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));
        }
Esempio n. 7
0
 public abstract bool IsValid(PlateInfo plateInfo);