public void AddToInventory_GivenANewInventoryItem_AddsToDatabase() { // arrange var newProduct = new Product() { Name = "TestProduct", CategoryID = 2 }; inventoryClient.AddProduct(newProduct); var products = inventoryClient.GetAllProducts(); var productList = new List <Product>(products.OrderBy(p => p.ID)); var productID = productList[productList.Count - 1].ID; var item = new InventoryItem() { ProductID = productID, UnitsInStock = 2121, WarehouseID = 5 }; // act inventoryClient.AddToInventory(item); // assert var actual = inventoryClient.GetStockByWarehouse("BloomSales W#5", productID); Assert.AreEqual(2121, actual.UnitsInStock); }