public async Task <int> GetItemCountInCart(Guid userCartId, CancellationToken cancellationToken = default) { var itemCount = userCartItemsRepository.GetCountAsync(userCartId, cancellationToken); var itemRentalCount = userCartItemRentalsRepository.GetItemCountInCartAsync(userCartId, cancellationToken); return(await itemCount + await itemRentalCount); }
public async Task GetItemCountInCartAsync() { var itemList = new List <Guid> { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() }; await userCartItemRentalsRepository.AddAsync(UserCartId, itemList); var itemCount = userCartItemRentalsRepository.GetItemCountInCartAsync(UserCartId); Assert.Equal(itemList.Count, itemCount); }