jjzjj

c# - 使用 Autofixture 控制对象树的生成深度

我正在尝试使用Autofixture控制对象树的生成深度。在某些情况下,我只想生成根对象,而在另一组情况下,我可能想生成达到特定深度(比方说2、3)的树。classFoo{publicstringName{get;set;}publicBarBar{get;set;}publicAnotherTypeXpto{get;set;}publicYetAnotherTypeXpto{get;set;}}classBar{publicstringName{get;set;}publicstringDescription{get;set;}publicAnotherTypeXpto{get;se