public CustomerReportGenerator( OrderReportGenerator orderReportGenerator, Func <Customer, ImmutableArray <Order> > getOrdersForCustomer) { this.orderReportGenerator = orderReportGenerator; this.getOrdersForCustomer = getOrdersForCustomer; }
static void Main(string[] args) { var orderReportFormattingSettings = new OrderReportFormattingSettings(args.Length > 0 && args[0].Equals("noNumberOfLines")); var cities = LoadAllDataWithoutOrders(); var orderReportGenerator = new OrderReportGenerator( orderReportFormattingSettings); var customerReportGenerator = new CustomerReportGenerator( orderReportGenerator, LoadOrdersForCustomer); var cityReportGenerator = new CityReportGenerator( customerReportGenerator); var reportGenerator = new ReportGenerator( cityReportGenerator); var report = reportGenerator.Generate(cities); SaveReport(report); }