No checks are in place for skipping the generation of reference types for a constructor. This will lead to a StackOverflowException if a reference type's constructor has itself as one of the parameters, even if that parameter is optional:
public class Node
{
public string Data { get; set; }
public Node Parent { get; set; }
public Node(string data, Node parent = null)
{
Data = data;
Parent = parent;
}
public static void Test()
{
var foo = AutoFaker.Generate<Node>(); // This will result in a StackOverflowException
}
}
No checks are in place for skipping the generation of reference types for a constructor. This will lead to a StackOverflowException if a reference type's constructor has itself as one of the parameters, even if that parameter is optional: