public List<ItemCategory> DoRead() { ItemCategoryRepository itemCategoryRepo = new ItemCategoryRepository(); List<ItemCategory> itemCategories = itemCategoryRepo.GetAll().ToList(); return itemCategories; }
public void ItemCategoryShouldBeUpdated() { IItemCategoryRepository itemCategoryRepo = new ItemCategoryRepository(); List<ItemCategory> itemCategories = new List<ItemCategory>() { new ItemCategory (){Id = 3,ItemCode = "CPUI001",ItemName = "IntelProcessing"}, new ItemCategory (){Id = 4,ItemCode = "CPUI002",ItemName = "AMDProcessing"} }; itemCategoryRepo.Update(itemCategories); }
public void ShouldReturnAllOfTheItemCategories() { IItemCategoryRepository itemCategoryRepo = new ItemCategoryRepository(); List<ItemCategory> itemCategories= itemCategoryRepo.GetAll().ToList(); Assert.AreEqual("1", itemCategories.Count().ToString()); }
public void ItemCategoryShouldBeFoundWhenSearching() { IItemCategoryRepository itemCategoryRepo = new ItemCategoryRepository(); List<ItemCategory> itemCategories = itemCategoryRepo.Search("ItemName","AMD").ToList(); Assert.AreEqual(2, itemCategories.Count); }
public void ItemCategoryShouldBeDeleted() { List<int> ids = new List<int> {1,2}; IItemCategoryRepository itemCategoryRepo = new ItemCategoryRepository(); itemCategoryRepo.Delete(ids); }
public void ItemCategoryShouldBeAdded() { var itemCategory = new ItemCategory { ItemCode = "CPUI002", ItemName = "AMD Processor" }; IItemCategoryRepository itemCategoryRepo = new ItemCategoryRepository(); itemCategoryRepo.Add(itemCategory); }