示例#1
0
        public async Task GetCustomerWishlistAsync_ShouldReturnList_WhenCustomerDoesExist()
        {
            //Arrange
            _customerService.GetCustomerAsync(customerId).Returns(existingCustomer);

            List <WishListProduct> list = new List <WishListProduct>();

            list.Add(new WishListProduct());

            _wishlistRepository.GetCustomerWishlistAsync(customerId).Returns(list);

            //Act
            var sut      = new WishlistService(_productRest, _customerService, _wishlistRepository);
            var products = await sut.GetCustomerWishlistAsync(customerId);

            //Assert
            Assert.NotNull(products);
            Assert.Single(products);
        }