예제 #1
0
 public async Task ReceiveItemDetails()
 {
     var result = await itemApi.GetAllItems();
     Assert.IsType<ItemResponses>(result);
     Assert.True(result.ItemResponse.Count == 10);
     foreach (var item in result.ItemResponse)
     {
         Assert.True(item.Price.Amount > 0);
         Assert.False(String.IsNullOrEmpty(item.Sku));
         Assert.False(String.IsNullOrEmpty(item.Gtin));
         Assert.False(String.IsNullOrEmpty(item.Wpid));
     }
 }
예제 #2
0
        public async Task ReceiveItemDetails()
        {
            ItemViewList result = await itemApi.GetAllItems();

            Assert.IsType <ItemViewList>(result);
            Assert.True(result.Items.Count == 10);
            foreach (ItemView item in result.Items)
            {
                Assert.True(item.Price.Amount > 0);
                Assert.False(string.IsNullOrEmpty(item.Sku));
                Assert.False(string.IsNullOrEmpty(item.Gtin));
                Assert.False(string.IsNullOrEmpty(item.Wpid));
            }
        }
예제 #3
0
        public async Task GetListOfItems()
        {
            var result = await itemApi.GetAllItems();

            Assert.IsType <ItemViewList>(result);
            foreach (var item in result.Items)
            {
                Assert.IsType <ItemView>(item);
                Assert.True(item.Sku.Length > 0);
            }
        }
        public async Task CanUpdatePricesInBulk()
        {
            var amount      = 400.0;
            var currency    = "USD";
            var oneItemList = await itemApi.GetAllItems(1, 10);

            var sku           = oneItemList.Items[0].Sku;
            var payloadStream = GetRequestContentForPriceUpdate("V2.requestStub.updatePrice", sku, amount, currency);
            var result        = await priceApi.UpdateBulkPrices(payloadStream);

            Assert.IsType <FeedAcknowledgement>(result);
            Assert.True(result.FeedId.Length > 0);
        }
예제 #5
0
        public async Task UpdateLagTime()
        {
            var items = await itemApi.GetAllItems(1, 10);

            var sku = items.Items[0].Sku;

            using (var stream = GetRequestBody(sku, "0"))
            {
                var result = await lagtimeApi.UpdateLagTime(stream);

                Assert.IsType <FeedAcknowledgement>(result);
            }
        }
예제 #6
0
        public async Task CanUpdatePromotionForSpecificSku()
        {
            var oneItemList = await itemApi.GetAllItems(1, 20);

            var sku = oneItemList.ItemResponse[0].Sku;

            //Delete the current promotions if there is any
            //var result = await promotionApi.GetPromotionPrice(sku);
            //Assert.IsType<ServiceResponse>(result);
            //StringWriter textWriter = new StringWriter();
            //xmlSerializer.Serialize(textWriter, result);
            //var str = textWriter.ToString();
            //var payload = GetPayloadForDelete(str, sku);

            using (var stream = GetRequestContentForPromotionUpdate(sku, "REDUCED", "DELETE"))
            {
                var result = await promotionApi.UpdatePromotionPrice(stream);

                Assert.IsType <ItemPriceResponse>(result);
                Assert.True(result.Mart.Length > 0);
                Assert.True(result.Sku == sku);
                Assert.True(result.Message.Length > 0);
            }
        }
예제 #7
0
        public string VerifyCredentials(Dictionary <string, object> args)
        {
            var spinner = new Spinner();

            try
            {
                spinner.Start();
                var task = endpointV2.GetAllItems(1);
                task.Wait();
            }
            catch (Exception ex)
            {
                return(String.Format("Invalid Creds. Error >{0}<", ex.Message));
            }
            finally
            {
                spinner.Stop();
            }

            return("Creds are valid!");
        }