Пример #1
0
        public ShopService(IDbDriver dbDriver, ILogger logger)
        {
            this.dbDriver = dbDriver;
            this.logger   = logger;

            article1 = new Article(1, "Article 1 from supplier 1", 458);
            article2 = new Article(2, "Article 2 from supplier 2", 459);
            article3 = new Article(3, "Article 3 from supplier 3", 460);
            article4 = new Article(1, "Article 1 from supplier 3", 457);

            supplier1 = new Supplier(1);
            dbDriver.SaveSupplier(supplier1);
            dbDriver.SaveArticle(supplier1, article1);

            supplier2 = new Supplier(2);
            dbDriver.SaveSupplier(supplier2);
            dbDriver.SaveArticle(supplier2, article2);

            supplier3 = new Supplier(3);
            dbDriver.SaveSupplier(supplier3);
            dbDriver.SaveArticle(supplier3, article3);
            dbDriver.SaveArticle(supplier3, article4);
        }