I want to create with Fixture a list of N objects.
I know I can do it with:
List<Person> persons = new List<Person>();
for (int i = 0; i < numberOfPersons; i++)
{
Person person = fixture.Build<Person>().Create();
persons.Add(person);
}
Is there any way I can use the CreateMany()
method or some other method in order to avoid the loop?
Found the answer. CreateMany has some overloads that get 'count'.
Thanks people.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With