Exemple #1
0
        public void CreateNewAccount()
        {
            var dbProvider = new InMemoryDbProvider();

            var shopManager = new ShopRepository(dbProvider);

            shopManager.CreateShop("First");

            var allShops = shopManager.GetShops();
            var ourNewShop = allShops.SingleOrDefault(x => x.Name == "First");

            Assert.IsNotNull(ourNewShop);
        }
        public void CanCreateProducts()
        {
            var dbProvider = new InMemoryDbProvider();

            var shopManager = new ShopRepository(dbProvider);
            shopManager.CreateShop("Test");

            var productRepo = new ProductRepository(dbProvider);
            productRepo.Create(new Product
            {
                Title = "First product"
            });

            var product = productRepo.GetProductByTitle("First product");

            Assert.IsNotNull(product);
            Assert.AreEqual("First product", product.Title);
        }