예제 #1
0
        public void AddSecondChanceItem()
        {
            Assert.IsNotNull(TestData.NewItem, "Failed because no item available -- requires successful AddItem test");
            AddSecondChanceItemCall api = new AddSecondChanceItemCall(this.apiContext);

            api.Item = TestData.NewItem;
            api.RecipientBidderUserID = TestData.ApiUserID;
            // Make API call.
            ApiException gotException = null;

            // VerifyAddSecondChanceItem
            try
            {
                api.AddSecondChanceItem(api.Item, api.RecipientBidderUserID);
            }
            catch (ApiException ex)
            {
                gotException = ex;
            }
            Assert.IsNotNull(gotException);
            // AddSecondChanceItem
            gotException = null;
            try
            {
                api.Execute();
            }
            catch (ApiException ex)
            {
                gotException = ex;
            }
            Assert.IsNotNull(gotException);
        }
        private void BtnAddSecondChanceItem_Click(object sender, System.EventArgs e)
        {
            try
            {
                TxtItemId.Text = "";

                ItemType item = FillItem();
                AddSecondChanceItemCall apicall = new AddSecondChanceItemCall(Context);

                apicall.RecipientBidderUserID = TxtRecipient.Text;

                apicall.AddSecondChanceItem(item, TxtRecipient.Text);

                TxtItemId.Text = item.ItemID;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }