示例#1
0
 public static IPostprocessComposer <T> FromFactory <T>(this IFactoryComposer <T> composer, Func <Random, T> factory)
 {
     return(composer.FromFactory <int>(value =>
     {
         using (var random = new PooledRandom(value))
         {
             return factory(random);
         }
     }));
 }
示例#2
0
 public static IPostprocessComposer <T> FromNumberGenerator <T>(this IFactoryComposer <T> composer,
                                                                Func <DbaseFieldNumberGenerator, T> factory)
 {
     return(composer.FromFactory <int>(value =>
     {
         using (var random = new PooledRandom(value))
         {
             return factory(new DbaseFieldNumberGenerator(random));
         }
     }));
 }
 FromFactory <T>(this IFactoryComposer <T> composer, Func <Random, T> factory) =>
 composer.FromFactory <int>(value => factory(new Random(value)));
示例#4
0
 public static IPostprocessComposer <T> FromFactory <T>(this IFactoryComposer <T> composer, Func <Random, T> factory) =>
 composer.FromFactory <int>(value => factory(new Random(value)));
示例#5
0
 private ISpecimenBuilder FromFactory <T>(IFactoryComposer <T> c) => c.FromFactory(new MethodInvoker(new PrivateGreedyConstructorQuery()));