public void AddToItemDescription() { string message,description,itemID,originalDes; ItemType item; bool isSuccess; Assert.IsNotNull(TestData.NewItem2, "Failed because no item available -- requires successful AddItem test"); AddToItemDescriptionCall api = new AddToItemDescriptionCall(this.apiContext); itemID = TestData.NewItem2.ItemID; originalDes = TestData.NewItem2.Description; description="SDK appended text."; DetailLevelCodeTypeCollection detailLevel=new DetailLevelCodeTypeCollection(); DetailLevelCodeType type=DetailLevelCodeType.ReturnAll; detailLevel.Add(type); api.DetailLevelList=detailLevel; // Make API call. api.AddToItemDescription(itemID,description); System.Threading.Thread.Sleep(3000); //check whether the call is success. Assert.IsTrue(api.ApiResponse.Ack==AckCodeType.Success || api.ApiResponse.Ack==AckCodeType.Warning,"do not success!"); isSuccess=ItemHelper.GetItem(TestData.NewItem2,this.apiContext,out message,out item); Assert.IsTrue(isSuccess,message); Assert.IsTrue(message==string.Empty,message); Assert.IsNotNull(item.Description,"the item description is null"); Assert.Greater(item.Description.Length,originalDes.Length); }
private void BtnAddToItemDescription_Click(object sender, System.EventArgs e) { try { TxtStatus.Text = ""; AddToItemDescriptionCall apicall = new AddToItemDescriptionCall(Context); apicall.AddToItemDescription(TxtItemId.Text, TxtAppend.Text); TxtStatus.Text = apicall.ApiResponse.Ack.ToString(); } catch(Exception ex) { MessageBox.Show(ex.Message); } }