public static CheckDigit ToNumeric(CheckDigitString checkDigitString) { var unvalidatedCheckDigit = Utilities.ToUnvalidatedNumeric(checkDigitString); var checkDigit = Utilities.Validate(unvalidatedCheckDigit); return(checkDigit); }
public static UnvalidatedCheckDigit ToUnvalidatedNumeric(CheckDigitString checkDigitString) { var unvalidatedCheckDigitValue = Utilities.DefaultCheckDigitToNumericConverter(checkDigitString.Value); var unvalidatedCheckDigit = new UnvalidatedCheckDigit(unvalidatedCheckDigitValue); return(unvalidatedCheckDigit); }
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); }
public static DescribedResult <bool> IsValid(CheckDigitString checkDigitString) { var output = Utilities.IsValidCheckDigit(checkDigitString.Value); return(output); }