public ManagerResponse <GetWishListResult, WishList> GetWishList(IVisitorContext visitorContext, IStorefrontContext storefrontContext)
        {
            Assert.ArgumentNotNull(storefrontContext, nameof(storefrontContext));
            Assert.ArgumentNotNull(visitorContext, nameof(visitorContext));
            string userId     = visitorContext.UserId;
            string shopName   = storefrontContext.CurrentStorefront.ShopName;
            string wishListId = "wishListId";

            GetWishListResult wishListResult = _wishListServiceProvider.GetWishList(new GetWishListRequest(userId, wishListId, shopName));

            Helpers.LogSystemMessages(wishListResult.SystemMessages, wishListResult);
            GetWishListResult serviceProviderResult = wishListResult;

            return(new ManagerResponse <GetWishListResult, WishList>(serviceProviderResult, serviceProviderResult.WishList));
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GetWishlistTest"/> class.
        /// </summary>
        public GetWishlistTest()
        {
            this.visitorId = Guid.NewGuid();
            this.request   = new GetWishListRequest(this.visitorId.ToString(), this.visitorId.ToString(), "NopShop");
            this.result    = new GetWishListResult();
            this.args      = new ServicePipelineArgs(this.request, this.result);

            this.client = Substitute.For <IWishlistsServiceChannel>();

            var clientFactory = Substitute.For <ServiceClientFactory>();

            clientFactory.CreateClient <IWishlistsServiceChannel>(Arg.Any <string>(), Arg.Any <string>()).Returns(this.client);

            this.processor = new GetWishlist {
                ClientFactory = clientFactory
            };
        }