public void AddFixedPriceItem() { if (TestData.NewFixedPriceItem != null) { string outMsg; ItemHelper.EndItem(this.apiContext, TestData.NewFixedPriceItem, out outMsg); TestData.NewFixedPriceItem = null; } ItemType item = ItemHelper.BuildItem(); item.ListingType = ListingTypeCodeType.FixedPriceItem; // Execute the API. FeeTypeCollection fees; // VerifyAddItem VerifyAddFixedPriceItemCall vi = new VerifyAddFixedPriceItemCall(this.apiContext); fees = vi.VerifyAddFixedPriceItem(item); Assert.IsNotNull(fees); // AddItem AddFixedPriceItemCall ai = new AddFixedPriceItemCall(this.apiContext); fees = ai.AddFixedPriceItem(item); Assert.IsNotNull(fees); // Save the result. TestData.NewFixedPriceItem = item; }
//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); }
private ItemType AddItem() { ItemType item = ItemHelper.BuildItem(); // Execute the API. FeeTypeCollection fees; // AddItem AddItemCall addItem = new AddItemCall(this.apiContext); fees = addItem.AddItem(item); Assert.IsNotNull(fees); // Save the result. return(item); }
private ItemType addAdFormatItem() { ItemType item = ItemHelper.BuildItem(); GetCategoryFeaturesCall api = new GetCategoryFeaturesCall(this.apiContext); DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.ReturnAll }; api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels); api.LevelLimit = 10; api.ViewAllNodes = true; bool viewAllNodes = true; bool isSuccess; CategoryTypeCollection categories; string message; //get an item which supports the Ad-format isSuccess = CategoryHelper.GetAdFormatCategory(this.apiContext, 1, out categories, out message); Assert.IsTrue(isSuccess, message); Assert.IsNotNull(categories); Assert.Greater(categories.Count, 0); Assert.IsTrue(categories[0].CategoryID != string.Empty); item.PrimaryCategory.CategoryID = categories[0].CategoryID; // get the list duration value according to the category CategoryFeatureTypeCollection features = api.GetCategoryFeatures(item.PrimaryCategory.CategoryID, api.LevelLimit, viewAllNodes, null, true); Assert.IsNotNull(features); Assert.Greater(features.Count, 0); Assert.IsNotNull(features[0].ListingDuration); Assert.Greater(features[0].ListingDuration.Count, 0); //modify item property to adapt the AdFormatItem item.ListingType = ListingTypeCodeType.AdType; item.ListingDuration = features[0].ListingDuration[0].Value.ToString(); // Execute the API. FeeTypeCollection fees; // AddItem AddItemCall addItem = new AddItemCall(this.apiContext); fees = addItem.AddItem(item); Assert.IsNotNull(fees); // Save the result. return(item); }
public void AddItemFull() { if (TestData.NewItem2 != null) { (new T_120_EndItemLibrary()).EndItemFull(); TestData.NewItem2 = null; } bool isSucess, isSupport = true; string message; ItemType item = ItemHelper.BuildItem(); item.PrimaryCategory.CategoryID = CATEGORYID.ToString(); //add Item AttributeSetArray //AttributeSetTypeCollection attributeSAT=GetAttributeSetCol(CATEGORYID,apiContext); //item.AttributeSetArray=attributeSAT; //check this category is custom specifics support FeatureIDCodeTypeCollection features = new FeatureIDCodeTypeCollection(); FeatureIDCodeType feature = FeatureIDCodeType.ItemSpecificsEnabled; features.Add(feature); isSucess = UnitTests.Helper.CategoryHelper.IsSupportFeature(CATEGORYID, features, apiContext, out isSupport, out message); System.Console.WriteLine(message); Assert.IsTrue(isSucess, "there are some errors during checkging the CategoryFeatures"); Assert.IsTrue(isSupport, "this category 104970 do not support the custom item specified any more!"); //add CIS item.ItemSpecifics = getCIS(); FeeTypeCollection fees; VerifyAddItemCall vi = new VerifyAddItemCall(apiContext); fees = vi.VerifyAddItem(item); Assert.IsNotNull(fees); AddItemCall addItemCall = new AddItemCall(apiContext);; fees = addItemCall.AddItem(item); //check whether the call is success. Assert.IsTrue(addItemCall.AbstractResponse.Ack == AckCodeType.Success || addItemCall.AbstractResponse.Ack == AckCodeType.Warning, "do not success!"); Assert.IsNotNull(fees); // Save the result. TestData.NewItem2 = item; }
/// <summary> /// add an item of chinese category. /// </summary> /// <returns></returns> private ItemType addChineseAuctionItem() { ItemType item = ItemHelper.BuildItem(); //modify the property to adapt the Chinese Type Item item.ListingType = ListingTypeCodeType.Chinese; item.Quantity = 1; // Execute the API. FeeTypeCollection fees; // AddItem AddItemCall addItem = new AddItemCall(this.apiContext); fees = addItem.AddItem(item); Assert.IsNotNull(fees); // Save the result. return(item); }
public void AddItemProPay() { ItemType item = ItemHelper.BuildItem(); item.PaymentMethods = new BuyerPaymentMethodCodeTypeCollection(new BuyerPaymentMethodCodeType[] { BuyerPaymentMethodCodeType.ProPay, BuyerPaymentMethodCodeType.PayPal }); // Execute the API. FeeTypeCollection fees; // VerifyAddItem VerifyAddItemCall vi = new VerifyAddItemCall(this.apiContext); fees = vi.VerifyAddItem(item); Assert.IsNotNull(fees); // AddItem AddItemCall addItem = new AddItemCall(this.apiContext); fees = addItem.AddItem(item); Assert.IsNotNull(fees); }
public void AddSellingManagerTemplate() { AddSellingManagerTemplateCall api = new AddSellingManagerTemplateCall(apiContext); String id_from_time = System.DateTime.Now.ToString("yyyyMMddhhmmss"); api.SaleTemplateName = "sale template" + id_from_time; api.ProductID = TestData.ProductId; ItemType item = ItemHelper.BuildItem(); api.Item = item; api.Execute(); //check whether the call is success. Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning, "do not success!"); long templateId = api.SaleTemplateID; long groupId = api.SaleTemplateGroupID; long productId = api.SellingManagerProductDetails.ProductID; TestData.SaleTemplateId = templateId; }
public void AddItem() { if (TestData.NewItem != null) { (new T_120_EndItemLibrary()).EndItem(); TestData.NewItem = null; } ItemType item = ItemHelper.BuildItem(); // Execute the API. FeeTypeCollection fees; // VerifyAddItem VerifyAddItemCall vi = new VerifyAddItemCall(this.apiContext); fees = vi.VerifyAddItem(item); Assert.IsNotNull(fees); // AddItem AddItemCall addItem = new AddItemCall(this.apiContext); fees = addItem.AddItem(item); Assert.IsNotNull(fees); // Save the result. TestData.NewItem = item; }