public void GetProductById() { using (var context = new Entity.StoreAppDBContext(options)) { IRepository _repo = new RepoDB(context); Model.Product result = _repo.GetProductById(1); Assert.NotNull(result); Assert.Equal("j-g-t-s-01", result.Barcode); } }
public void UpdateInventoryByProductId() { using (var context = new Entity.StoreAppDBContext(options)) { IRepository _repo = new RepoDB(context); Model.Product product = _repo.GetProductById(1); _repo.UpdateInventory(product, 10); var result = _repo.GetInventory(product); Assert.Equal("j-g-t-s-01", product.Barcode); Assert.Equal(10, result.Quantity); } }