Пример #1
0
 public EbayFacade()
 {
     InitializeContext();
     api2call = new AddFixedPriceItemCall(Context);
     reviseItemCall = new ReviseFixedPriceItemCall(Context);
     deleteItemCall = new EndItemCall(Context);
 }
		public void ReviseFixedPriceItem()
		{
			ItemType itemTest = TestData.NewFixedPriceItem;
			Assert.IsNotNull(itemTest);
			//
			ReviseFixedPriceItemCall rviCall = new ReviseFixedPriceItemCall(this.apiContext);
			ItemType item = new ItemType();
			item.ItemID = itemTest.ItemID;
			item.StartPrice = new AmountType(); 
			item.StartPrice.Value = 2.89; 
			item.StartPrice.currencyID = CurrencyCodeType.USD;
			rviCall.Item = item;
			rviCall.Execute();
			// Let's wait for the server to "digest" the data.
			System.Threading.Thread.Sleep(1000);
			//check whether the call is success.
			Assert.IsTrue(rviCall.AbstractResponse.Ack==AckCodeType.Success || rviCall.AbstractResponse.Ack==AckCodeType.Warning,"do not success!");
			// Call GetItem and then compare the startPrice.
			GetItemCall getItem = new GetItemCall(this.apiContext);
			DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] {
																			   DetailLevelCodeType.ReturnAll
																		   };
			getItem.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);
			ItemType returnedItem = getItem.GetItem(itemTest.ItemID);
			Assert.AreEqual(returnedItem.StartPrice.Value, item.StartPrice.Value);
			// Update itemTest.
			TestData.NewFixedPriceItem = returnedItem;
			
		}