Ejemplo n.º 1
0
        public AccountCheckResult Check(BankDetails bankDetails)
        {
            var modulusparametersFactory = new ModulusParametersFactory(_modulusWeightingTable);
            var modulusChecker           = new StandardModulusCheck(modulusparametersFactory.CreateModulusParameters(bankDetails));

            return(new AccountCheckResult(modulusChecker.IsValid(bankDetails)));
        }
Ejemplo n.º 2
0
        public ModulusParameters CreateModulusParameters(BankDetails bankAccount)
        {
            var modulusWeighting = _modulusWeightingTable.Find(bankAccount);
            ModulusCheckingMethod modulusCheckingMethod;

            if (modulusWeighting == null)
            {
                modulusCheckingMethod = ModulusCheckingMethod.None;
            }
            else
            {
                modulusCheckingMethod = modulusWeighting.CheckingMethod;
            }

            return(new ModulusParameters(modulusCheckingMethod, modulusWeighting));
        }
Ejemplo n.º 3
0
 public ModulusWeightingDetails Find(BankDetails bankDetails)
 {
     return(_modulusWeightings.FirstOrDefault(m => String.Compare(bankDetails.SortCode, m.FromSortCode, StringComparison.Ordinal) >= 0 && String.Compare(bankDetails.SortCode, m.ToSortCode, StringComparison.Ordinal) <= 0));
 }