public override bool IsValid(InputTypes type) { if (type == InputTypes.Username || type == InputTypes.Password) { return(base.IsValid(type)); } Regex re = new Regex(InputTypeValue.Value(type)); switch (type) { case InputTypes.FirstName: return(re.IsMatch(user.GetFirstName())); case InputTypes.LastName: return(re.IsMatch(user.GetLastName())); case InputTypes.Email: return(RegexUtilities.IsValidEmail(user.GetEmail())); case InputTypes.FullAddress: return(AddressAPI.IsAddressValid(user)); default: return(false); } }
public void CityStateLookupError() { ZipCode zip = new() { Zip5 = "7220" }; zip = AddressAPI.LookupCityState(zip); Assert.IsNotNull(zip.Error); }
public async Task CityStateLookupError() { ZipCode zip = new() { Zip5 = "7220" }; zip = await AddressAPI.LookupCityStateAsync(zip); Assert.IsNotNull(zip.Error); }
public void CityStateLookup() { ZipCode zip = new() { Zip5 = "72201" }; zip = AddressAPI.LookupCityState(zip); Assert.IsTrue(!String.IsNullOrEmpty(zip.City)); Assert.IsTrue(!String.IsNullOrEmpty(zip.State)); }
public async Task CityStateLookup() { ZipCode zip = new() { Zip5 = "72201" }; zip = await AddressAPI.LookupCityStateAsync(zip); Assert.IsTrue(!String.IsNullOrEmpty(zip.City)); Assert.IsTrue(!String.IsNullOrEmpty(zip.State)); }
public void ZipLookup() { Address addr = new() { Address1 = "500 woodlane street", City = "little rock", State = "arkansas" }; addr = AddressAPI.LookupZipCode(addr); Assert.IsTrue(!String.IsNullOrEmpty(addr.Zip5)); }
public async Task ValidateAddress() { string add1 = "500 woodlane street"; Address addr = new() { Address1 = add1, City = "little rock", State = "arkansas", Zip5 = "72201" }; addr = await AddressAPI.ValidateAddressAsync(addr); Assert.IsTrue(add1 != addr.Address1); }
public void ValidateAddress() { string add1 = "500 woodlan stret"; Address addr = new() { Address1 = add1, City = "litle rock", State = "arkansas", Zip5 = "72201" }; addr = AddressAPI.ValidateAddress(addr); Assert.IsTrue(add1 != addr.Address1); }