private static void SalesReportTest() { FakeOrdersService ordersService = new FakeOrdersService(); IEnumerable <Order> orders = ordersService.Get(); ISalesReportBuilder salesReportBuilder = new MySalesReportBuilder(orders); salesReportBuilder.AddHeader("Raport sprzedaży"); salesReportBuilder.AddSectionByGender(); salesReportBuilder.AddSectionByProduct(); SalesReport salesReport = salesReportBuilder.Build(); Console.WriteLine(salesReport); }
private static void SalesReportTest() { bool hasSectionByGender = true; FakeOrdersService ordersService = new FakeOrdersService(); IEnumerable <Order> orders = ordersService.Get(); ISalesReportBuilder salesReportBuilder = new MySalesReportBuilder(orders); salesReportBuilder.AddHeader(); if (hasSectionByGender) { salesReportBuilder.AddSectionByGender(); } salesReportBuilder.AddSectionByProduct(); SalesReport salesReport = salesReportBuilder.Build(); Console.WriteLine(salesReport); }