예제 #1
0
        public Notification ValidatePhoneNumber(string cellPhoneToValidate)
        {
            ICellPhoneValidator cellPhoneValidator = Account.GetCellPhoneValidator(CurrentCountry);
            Notification        notification       = cellPhoneValidator.ValidateCellPhone(cellPhoneToValidate);

            return(notification);
        }
예제 #2
0
        public Notification AddAccount(Account account)
        {
            Notification        notification;
            ICellPhoneValidator cellPhoneValidator = Account.GetCellPhoneValidator(account.AccountCountry);

            notification = cellPhoneValidator.ValidateCellPhone(account.AccountCellPhoneNumber);
            if (!notification.HasErrors())
            {
                Add(account);
                notification.AddSuccess("Cuenta creada con éxito");
            }
            return(notification);
        }
예제 #3
0
        public void GetCellPhoneValidatorTest()
        {
            ICellPhoneValidator cellPhoneValidator = Account.GetCellPhoneValidator(new Country("URUGUAY"));

            Assert.AreEqual(new UyCellPhoneValidator().CellPhoneValidatorCountry, cellPhoneValidator.CellPhoneValidatorCountry);
        }
예제 #4
0
        public string FormatPhoneNumber(string cellPhoneToFormat)
        {
            ICellPhoneValidator cellPhoneValidator = Account.GetCellPhoneValidator(CurrentCountry);

            return(cellPhoneValidator.StandarizePhoneNumber(cellPhoneToFormat));
        }