示例#1
0
        public static CheckDigit ToNumeric(CheckDigitString checkDigitString)
        {
            var unvalidatedCheckDigit = Utilities.ToUnvalidatedNumeric(checkDigitString);

            var checkDigit = Utilities.Validate(unvalidatedCheckDigit);

            return(checkDigit);
        }
示例#2
0
        public static UnvalidatedCheckDigit ToUnvalidatedNumeric(CheckDigitString checkDigitString)
        {
            var unvalidatedCheckDigitValue = Utilities.DefaultCheckDigitToNumericConverter(checkDigitString.Value);

            var unvalidatedCheckDigit = new UnvalidatedCheckDigit(unvalidatedCheckDigitValue);

            return(unvalidatedCheckDigit);
        }
示例#3
0
        public static DescribedResult <bool> TryValidate(UnvalidatedCheckDigitString unvalidatedCheckDigitString, out CheckDigitString checkDigitString)
        {
            var isValid = Utilities.IsValid(unvalidatedCheckDigitString);

            if (isValid.Value)
            {
                checkDigitString = new CheckDigitString(unvalidatedCheckDigitString.Value);
            }
            else
            {
                checkDigitString = CheckDigitString.Invalid;
            }

            return(isValid);
        }
示例#4
0
        public static DescribedResult <bool> IsValid(CheckDigitString checkDigitString)
        {
            var output = Utilities.IsValidCheckDigit(checkDigitString.Value);

            return(output);
        }