public void GetInventoryList_ShouldReturnAllItems() { var context = new TestInventory(); context.InventoryList.Add(new Inventory { ID = 1, Name = "Demo1", Description = "desc1", Price = 20 }); context.InventoryList.Add(new Inventory { ID = 2, Name = "Demo2", Description = "desc2", Price = 30 }); context.InventoryList.Add(new Inventory { ID = 3, Name = "Demo3", Description = "desc3", Price = 40 }); var controller = new InventoriesController(context); var result = controller.GetInventoryList() as TestInventoryDbSet; Assert.IsNotNull(result); Assert.AreEqual(3, result.Local.Count); }