当AutoFixture进行多次自定义时,需要将每个自定义添加到一个列表中,最后使用CompositeCustomization将它们组合在一起。以下是一个示例:
var fixture = new Fixture();
var customizations = new List
{
new PersonCustomization(),
new AddressCustomization(),
new PhoneNumberCustomization(),
};
var compositeCustomization = new CompositeCustomization(customizations);
fixture.Customize(compositeCustomization);