public ManagerResponse <RemoveWishListLinesResult, WishList> RemoveWishListLines(CommerceStorefront storefront, IVisitorContext visitorContext, WishList wishList, IEnumerable <string> wishListLineIds) { Assert.ArgumentNotNull(storefront, nameof(storefront)); Assert.ArgumentNotNull(visitorContext, nameof(visitorContext)); Assert.ArgumentNotNull(wishList, nameof(wishList)); Assert.ArgumentNotNull(wishListLineIds, "cartLinesIds"); RemoveWishListLinesResult serviceProviderResult = _wishListServiceProvider.RemoveWishListLines(new RemoveWishListLinesRequest(wishList, wishListLineIds)); return(new ManagerResponse <RemoveWishListLinesResult, WishList>(serviceProviderResult, serviceProviderResult.WishList)); }
/// <summary> /// Initializes a new instance of the <see cref="RemoveWishlistLinesTest"/> class. /// </summary> public RemoveWishlistLinesTest() { this.visitorId = Guid.NewGuid(); this.lineToRemove = new WishListLine() { ExternalId = "10", Product = new CartProduct { ProductId = "100500", Price = new Price { Amount = 100 } }, Quantity = 12 }; this.wishlist = new WishList { ExternalId = this.visitorId.ToString(), Lines = new ReadOnlyCollection <WishListLine>(new List <WishListLine> { this.lineToRemove }) }; this.request = new RemoveWishListLinesRequest(this.wishlist, new List <string> { "10" }); this.result = new RemoveWishListLinesResult(); 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 RemoveWishlistLines { ClientFactory = clientFactory }; }