public void AddsQuantityToInventory(int quantity)
        {
            var options = new DbContextOptionsBuilder <StoreDbContext>().UseInMemoryDatabase(databaseName: "TestDb").Options;

            Inventory     inventory = new Inventory();
            StoreLocation store     = new StoreLocation();
            Product       product   = new Product();

            using (var context = new StoreDbContext(options))
            {
                context.Database.EnsureDeleted();
                context.Database.EnsureCreated();
                StoreDataLayer repo = new StoreDataLayer(context);

                store   = repo.CreateStore("TargWal", "San Diego");
                product = repo.CreateProduct("name", "desc", 26.00M, false);

                inventory = repo.AssignInventory(product, store, quantity);
            }

            using (var context = new StoreDbContext(options))
            {
                StoreDataLayer repo      = new StoreDataLayer(context);
                Inventory      invResult = repo.AssignInventory(product, store, 20);
                int            result    = quantity + 20;

                Assert.Equal(invResult.ProductQuantity, result);
            }
        }
        public void CreatesNewProductEachTime(string name, string desc, decimal price, bool restricted)
        {
            var options = new DbContextOptionsBuilder <StoreDbContext>().UseInMemoryDatabase(databaseName: "TestDb").Options;

            Product p = new Product();

            using (var context = new StoreDbContext(options))
            {
                context.Database.EnsureDeleted();
                context.Database.EnsureCreated();
                StoreDataLayer repo = new StoreDataLayer(context);
                p = repo.CreateProduct(name, desc, price, restricted);
            }

            using (var context = new StoreDbContext(options))
            {
                StoreDataLayer repo   = new StoreDataLayer(context);
                Product        result = repo.CreateProduct("name", "desc", 26.00M, false);
                Assert.NotEqual(p.ProductID, result.ProductID);
            }
        }