/// <summary> /// Fill the target property with a random value from the specified enumerable /// </summary> /// <param name="values">A enumerable of values to choose from</param> /// <returns>A configurator for the target object type</returns> public AngieConfigurator <T> WithRandom(IEnumerable <short> values) { CustomFiller <short> customFiller = new CustomFiller <short>(PropertyInfo.Name, typeof(T), () => BaseValueGenerator.GetRandomValue(values)); _maggie.RegisterFiller(customFiller); return(this); }
/// <summary> /// Fill the target property with a random value from the specified array /// </summary> /// <param name="values">A array of values to choose from</param> /// <returns>A configurator for the target object type</returns> public AngieConfigurator <T> WithRandom(T2[] values) { CustomFiller <T2> customFiller = new CustomFiller <T2>(PropertyInfo.Name, typeof(T), () => BaseValueGenerator.GetRandomValue(values)); _fillerManager.RegisterFiller(customFiller); return(this); }