Example #1
0
        public DriverNIF(long nif)
        {
            if (!NumberValidator.isValidNIF(nif))
            {
                throw new BusinessRuleValidationException(nif + " invalid: Driver NIF is invalid");
            }

            if (NumberValidator.isNegative(nif))
            {
                throw new BusinessRuleValidationException(nif + " invalid: Driver NIF can't be negative");
            }

            this.nif = nif;
        }
Example #2
0
        public CitizenCardNumber(long citizenCardNumber)
        {
            if (!NumberValidator.isValidCitizenCardNumber(citizenCardNumber))
            {
                throw new BusinessRuleValidationException(citizenCardNumber + " invalid: Driver Citizen Card Number invalid");
            }

            if (NumberValidator.isNegative(citizenCardNumber))
            {
                throw new BusinessRuleValidationException(citizenCardNumber + " invalid: Driver Citizen Card Number can't be negative");
            }

            this.citizenCardNumber = citizenCardNumber;
        }