public void CreateDatapool <T>(string name) where T : class { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException("name"); } TypeHelper.LoadTargetTypeFromProperty <T>(GetPropertyKey(name, "valueType"), null); IDatapoolValuesFactory <T> valuesFactory = TypeHelper.CreateTargetTypeFromProperty <IDatapoolValuesFactory <T> >(GetPropertyKey(name, "factoryType"), null); CreateDatapool(valuesFactory, name); }
public void CreateDatapool <T>(IDatapoolValuesFactory <T> datapoolValuesFactory, string name) where T : class { if (datapoolValuesFactory == null) { throw new ArgumentNullException("datapoolValuesFactory"); } if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException("name"); } IList <T> values = datapoolValuesFactory.CreateValues(GrinderContext, name); bool isRandom = bool.Parse(GrinderContext.GetProperty(GetPropertyKey(name, "random"), bool.FalseString)); int seed = int.Parse(GrinderContext.GetProperty(GetPropertyKey(name, "seed"), ((int)DateTime.Now.Ticks).ToString())); var distributionMode = (DatapoolThreadDistributionMode)Enum.Parse(typeof(DatapoolThreadDistributionMode), GrinderContext.GetProperty(GetPropertyKey(name, "distributionMode"), DatapoolThreadDistributionMode.ThreadShared.ToString()), false); bool isCircular = bool.Parse(GrinderContext.GetProperty(GetPropertyKey(name, "circular"), bool.TrueString)); var datapoolMetatdata = new DefaultDatapoolMetadata <T>(values, isRandom, seed, distributionMode, isCircular, name); CreateDatapool(datapoolMetatdata); }
public void CreateDatapool <T>(IDatapoolValuesFactory <T> datapoolValuesFactory) where T : class { CreateDatapool(datapoolValuesFactory, typeof(T).Name); }