private static Shop BuildShop()
 {
     var productRepository = new ProductRepository();
     var productFactory = new ProductFactory(productRepository);
     var discountCalculator = new DiscountCalculator();
     var productSales = new List<IProductSale> {new ProductASale(discountCalculator), new ProductBSale(discountCalculator)};
     return new Shop(productFactory, productSales);
 }
Пример #2
0
 public Shop(ProductFactory productFactory, List<IProductSale> sales)
 {
     this.productFactory = productFactory;
     this.sales = sales;
 }