This seems to be something lacking in every blog post of piece of documentation I read.
How can I CreateMany<T>
where only 1 of the elements in the collection contains an Id
of something I specify?
I want to pull this back into a customization.
I tried many variations of something like this:
public class OrdersCustomizations : ICustomization
{
public void Customize(IFixture fixture)
{
var single = fixture.Build<Order>().With(x => x.Id, 10).Create();
var many = fixture.Build<Order>().CreateMany().ToList();
many.Add(single);
fixture.RepeatCount = 5;
fixture.AddManyTo<Order>(many);
}
}
But I can't figure this out.