public void PhoneNumberIsExpectedLength() { for (int i = 0; i < 1000; i++) { var phoneNumber = ContactInformation.PhoneNumber(); Assert.Equal(14, phoneNumber.Length); } }
/// <summary> /// Populate the specified property with a valid phone number /// </summary> /// <typeparam name="T">The target object type</typeparam> /// <param name="configurator"></param> /// <returns>A configurator for the specified object type</returns> public static GenFuConfigurator <T> AsPhoneNumber <T>(this GenFuStringConfigurator <T> configurator) where T : new() { CustomFiller <string> filler = new CustomFiller <string>(configurator.PropertyInfo.Name, typeof(T), () => ContactInformation.PhoneNumber()); configurator.Maggie.RegisterFiller(filler); return(configurator); }
public override object GetValue(object instance) { return(ContactInformation.PhoneNumber()); }