Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public Basket ChangeItemQuantity(string customerId, string itemId, int newQuantity)
 {
     _basketStore.ChangeItemQuantity(customerId, itemId, newQuantity);
     return(GetBasketByCustomerId(customerId));
 }