/// <summary>
        /// Fill the target property with a random value from the specified list
        /// </summary>
        /// <param name="values">A list of values to choose from</param>
        /// <returns>A configurator for the target object type</returns>
        public GenFuConfigurator <T> WithRandom(List <string> values)
        {
            CustomFiller <string> customFiller = new CustomFiller <string>(this.GenFu, PropertyInfo.Name, typeof(T), () => BaseValueGenerator.GetRandomValue(values));

            _fillerManager.RegisterFiller(customFiller);
            return(this);
        }
示例#2
0
        /// <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 GenFuConfigurator <T> WithRandom(IEnumerable <decimal> values)
        {
            CustomFiller <decimal> customFiller = new CustomFiller <decimal>(PropertyInfo.Name, typeof(T), () => BaseValueGenerator.GetRandomValue(values));

            _fillerManager.RegisterFiller(customFiller);
            return(this);
        }
示例#3
0
 public override object GetValue(object instance)
 {
     return(BaseValueGenerator.Word());
 }