예제 #1
0
        public void DeleteCategoryItem_ShouldPass()
        {
            using var context = new MarketDbContext(inMemoryConnection);

            Item item = SetUpInvetoryWithOneItem(context);

            storeInventory.AddCategoryItem(item.Id, "cat2", context);

            Assert.IsTrue(storeInventory.DeleteCategoryItem(item.Id, "cat1", context));

            Assert.AreEqual(1, item.Categories.Count);
            Assert.IsTrue(item.Categories.Contains(new Category("cat2")));
            Assert.IsFalse(item.Categories.Contains(new Category("cat1")));
        }