Given the following classes:
class Department { public String Name { get; set; } public IList<Employee> Employees { get; set; } } class Employee { public String Name { get; set; } public String Address { get; set; } }
With NBuilder, I can create a department object and assign 10 employees as follows:
var employees = Builder<Employee>.CreateListOfSize(10).Build(); var department = Builder<Department> .CreateNew() .With(d=>d.Employees = employees) .Build();
This works with a small number of collections, but it is cumbersome with a large one. Is there a way for NBuilder to automatically fill all collections in an object?
By the way, I am not tied to NBuilder, so if there is another free library that will do this, I would gladly switch.
source share