Esempio n. 1
0
        public void AddItems()
        {
            if(TestData.itemIds!=null)
            {
                //call endItems call
                new T_125_EndItemsLibrary().EndItems();
            }
            TestData.itemIds=new StringCollection();

            AddItemsCall api=new AddItemsCall(this.apiContext);

            AddItemRequestContainerTypeCollection itemsContainers=new AddItemRequestContainerTypeCollection();
            //add five item one time,this should be successed
            foreach(string category in CATEGORY_ID)
            {
                addItemToContainer(itemsContainers,category);
            }
            api.AddItemRequestContainerList=itemsContainers;

            api.Execute();

            //check whether the call is success.
            Assert.IsTrue(api.ApiResponse.Ack==AckCodeType.Success || api.ApiResponse.Ack==AckCodeType.Warning,"do not success!");
            Assert.IsNotNull(api.AddItemResponseContainerList);
            Assert.AreEqual(api.AddItemResponseContainerList.Count,5);
            foreach(AddItemResponseContainerType containerType in api.AddItemResponseContainerList)
            {
                Assert.IsNotNull(containerType.Fees);
                Assert.IsTrue(containerType.Fees.Count>0);
                Assert.IsTrue(containerType.ItemID!=string.Empty);
                //cache item id
                TestData.itemIds.Add(containerType.ItemID);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Defines from one to five items and lists them on a specified eBay site.
        /// </summary>
        ///
        /// <param name="AddItemRequestContainerList">
        /// Defines a single item to be listed on eBay. This container is similar to an <b>AddItem</b> request. Up to five of these containers can be included in one <b>AddItems</b> request.
        /// </param>
        ///
        public AddItemResponseContainerTypeCollection AddItems(AddItemRequestContainerTypeCollection AddItemRequestContainerList)
        {
            this.AddItemRequestContainerList = AddItemRequestContainerList;

            Execute();
            return(ApiResponse.AddItemResponseContainer);
        }
Esempio n. 3
0
		/// <summary>
		/// Defines from one to five items and lists them on a specified eBay site.
		/// </summary>
		/// 
		/// <param name="AddItemRequestContainerList">
		/// Defines a single item to be listed on eBay. This container is similar to an <b>AddItem</b> request. Up to five of these containers can be included in one <b>AddItems</b> request.
		/// </param>
		///
		public AddItemResponseContainerTypeCollection AddItems(AddItemRequestContainerTypeCollection AddItemRequestContainerList)
		{
			this.AddItemRequestContainerList = AddItemRequestContainerList;

			Execute();
			return ApiResponse.AddItemResponseContainer;
		}
        public void AddItems()
        {
            if (TestData.itemIds != null)
            {
                //call endItems call
                new T_125_EndItemsLibrary().EndItems();
            }
            TestData.itemIds = new StringCollection();

            AddItemsCall api = new AddItemsCall(this.apiContext);

            AddItemRequestContainerTypeCollection itemsContainers = new AddItemRequestContainerTypeCollection();

            //add five item one time,this should be successed
            foreach (string category in CATEGORY_ID)
            {
                addItemToContainer(itemsContainers, category);
            }
            api.AddItemRequestContainerList = itemsContainers;

            api.Execute();

            //check whether the call is success.
            Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning, "do not success!");
            Assert.IsNotNull(api.AddItemResponseContainerList);
            Assert.AreEqual(api.AddItemResponseContainerList.Count, 5);
            foreach (AddItemResponseContainerType containerType in api.AddItemResponseContainerList)
            {
                Assert.IsNotNull(containerType.Fees);
                Assert.IsTrue(containerType.Fees.Count > 0);
                Assert.IsTrue(containerType.ItemID != string.Empty);
                //cache item id
                TestData.itemIds.Add(containerType.ItemID);
            }
        }
Esempio n. 5
0
 //add item to container with specific categoryid
 private void addItemToContainer(AddItemRequestContainerTypeCollection itemsContainers,string categoryID)
 {
     AddItemRequestContainerType itemContainer = new AddItemRequestContainerType();
     ItemType item = ItemHelper.BuildItem();
     item.PrimaryCategory.CategoryID=categoryID;
     itemContainer.Item=item;
     itemContainer.MessageID=Convert.ToString(itemsContainers.Count+1);
     itemsContainers.Add(itemContainer);
 }
        //add item to container with specific categoryid
        private void addItemToContainer(AddItemRequestContainerTypeCollection itemsContainers, string categoryID)
        {
            AddItemRequestContainerType itemContainer = new AddItemRequestContainerType();
            ItemType item = ItemHelper.BuildItem();

            item.PrimaryCategory.CategoryID = categoryID;
            itemContainer.Item      = item;
            itemContainer.MessageID = Convert.ToString(itemsContainers.Count + 1);
            itemsContainers.Add(itemContainer);
        }