I'm using xunit and FsCheck from C# to generate random class data. Because of EF some of them are containing a ICollection<ChildElement> Children {get; set;}
properties. Because of such properties generator gets stuck. I'm aware of possiblity to define own generator for particular class. But it is tempting and I can miss a property.
Is it possible to define a more general solution for this? Following generator doesn't work either:
public class ICollectionGenerator
{
public static Arbitrary<ICollection<T>> Collection<T>()
{
return Arb.From(Arb.Generate<List<T>>().Select(x => (ICollection<T>)x));
}
}