Ejemplo n.º 1
0
 public static ISetGen <T> Set <T>(IGen <T> elementGen) => new SetGen <T>(
     ElementGen: elementGen,
     Count: RangeIntention.Unspecified());
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a generator that produces lists, the elements of which are produced by the given generator. By
 /// default, the generator produces lists ranging from count 0 to 20 - but this can be configured using the
 /// builder methods on <see cref="IListGen{T}"/>.
 /// </summary>
 /// <param name="elementGen">The generator used to produce the elements of the list.</param>
 /// <returns>The new generator.</returns>
 public static IListGen <T> List <T>(IGen <T> elementGen) => new ListGen <T>(
     ElementGen: elementGen,
     Count: RangeIntention.Unspecified(),
     Bias: null,
     EnableCountLimit: null);
Ejemplo n.º 3
0
 public static RangeIntention WithMaximum(this RangeIntention r, int maximum) => r.Match(
     onUnspecified: () => RangeIntention.Bounded(null, maximum),
     onExact: (_) => RangeIntention.Bounded(null, maximum),
     onBounded: (minimum, _) => RangeIntention.Bounded(minimum, maximum));