Example #1
0
        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);
        }
Example #2
0
        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);
        }