public async Task GetBasket_should_return_basket_successfuly()
        {
            var item = new BasketItem {
            };
            const string customerId = "customerId";
            await _repository.UpdateBasketAsync(item, customerId);

            const string id     = "one";
            var          basket = await _repository.GetBasketAsync(id);

            Assert.NotNull(basket);
            Assert.Single(basket.Items);
        }
示例#2
0
        public async Task <BasketModel> Update_existing_basket()
        {
            //Arrange
            var existingBasket = await Get_Add_basket();

            existingBasket.Items.Add(new Item {
                Id = 7, RentalDays = 7
            });

            //Act
            var actualBasket = await _basketRepository.UpdateBasketAsync(existingBasket);

            //Assert
            Assert.NotNull(actualBasket);
            Assert.Equal(existingBasket.Id, actualBasket.Id);
            Assert.Single(actualBasket.Items);
            Assert.Equal(7, actualBasket.Items[0].Id);
            return(actualBasket);
        }