public void UpdateItemQuantity_should_update_item_quantity(int initialQuantity, int newQuantity, int expected) { _baskets.Add(new Basket(_testCustomerId, new List <Item> { new Item("Item1", initialQuantity) })); _sut.ChangeItemQuantity(_testCustomerId, "Item1", newQuantity); _baskets.First().Items.Count.Should().Be(1); _baskets.First().Items.First().ItemId.Should().Be("Item1"); _baskets.First().Items.First().Quantity.Should().Be(expected); }
public Basket ChangeItemQuantity(string customerId, string itemId, int newQuantity) { _basketStore.ChangeItemQuantity(customerId, itemId, newQuantity); return(GetBasketByCustomerId(customerId)); }