public void Parse_GetItemResponseWithVariationsSku_HookupVariationSkus()
        {
            //A
            using (var fs = new FileStream(@".\Files\GetItemResponse\EbayServiceGetItemResponseWithItemVariations.xml", FileMode.Open, FileAccess.Read))
            {
                //A
                var orders = new EbayGetItemResponseParser().Parse(fs);

                //A
                orders.Item.Variations.TrueForAll(x => !string.IsNullOrWhiteSpace(x.Sku)).Should().BeTrue("because in source file there is item with variation skus");
            }
        }
        public void Parse_GetItemResponseWithSku_HookupSku()
        {
            //A
            using (var fs = new FileStream(@".\Files\GetItemResponse\EbayServiceGetItemResponseWithItemSku.xml", FileMode.Open, FileAccess.Read))
            {
                //A
                var orders = new EbayGetItemResponseParser().Parse(fs);

                //A
                orders.Item.Sku.Should().NotBeNullOrWhiteSpace("because in source file there is item with sku");
            }
        }
Ejemplo n.º 3
0
        public async Task <Item> GetItemAsync(string id, string mark)
        {
            var order = new Item();

            var body = this.CreateGetItemByIdRequestBody(id);

            var headers = CreateGetItemRequestHeadersWithApiCallName();

            await ActionPolicies.GetAsync.Do(async() =>
            {
                var webRequest = await this.CreateEbayStandartPostRequestAsync(this._endPoint, headers, body, mark, CancellationToken.None).ConfigureAwait(false);

                using (var memStream = await this._webRequestServices.GetResponseStreamAsync(webRequest, mark, CancellationToken.None).ConfigureAwait(false))
                {
                    var tempOrders = new EbayGetItemResponseParser().Parse(memStream);
                    if (tempOrders != null)
                    {
                        order = tempOrders.Item;
                    }
                }
            });

            return(order);
        }