【发布时间】:2011-03-31 13:30:34
【问题描述】:
我之前在此链接上发布了一个问题:
Class with a nested collection - how do I populate the nested class?
我需要能够做同样的事情,但使用嵌套类:
像这样:
public class ParentClass
{
public int Value;
public IList<ChildClass> Children;
}
public class ChildClass
{
etc...
}
我试过了:
Fixture.Register(()=>Fixture.CreateMany<ChildClass>();
但这不起作用,有什么想法吗? 我正在使用 AutoFixture 2.0。
【问题讨论】:
标签: c# autofixture