private static IEnumerable <IEnumerable <T> > ShrinkOne <T> (IEnumerable <T> e) { if (e.None()) { return(new IEnumerable <T> [0]); } var first = e.First(); var rest = e.Skip(1); return((from x in Arbitrary.Get <T> ().Shrink(first) select rest.Append(x)).Concat( from xs in ShrinkOne(e.Skip(1)) select xs.Append(first))); }
public static Property <T> Choose <T> () { return(ForAll(Arbitrary.Get <T> ())); }
/* * The other version of the ForAll method can be called without specifying * the IArbitrary instance. The method uses the default arbitrary * implementation that is registered for the given type. */ public static Prop <T> ForAll <T> () { return(ForAll(Arbitrary.Get <T> ())); }