public void GetSellerEventsFull() { Assert.IsNotNull(TestData.NewItem2, "Failed because no item available -- requires successful AddItem test"); GetSellerEventsCall api = new GetSellerEventsCall(this.apiContext); //specify more info string categoryID = TestData.NewItem2.PrimaryCategory.CategoryID; DateTime endTimeFrom = DateTime.Now.AddDays(-1); DateTime endTimeTo = DateTime.Now.AddDays(1); //these properties how to use? bool IncludeWatchCount = true; PaginationType pagination = new PaginationType(); pagination.PageNumber = 1; pagination.EntriesPerPage = 20; api.EndTimeFrom = endTimeFrom; api.EndTimeTo = endTimeTo; api.IncludeWatchCount = IncludeWatchCount; api.DetailLevelList = new DetailLevelCodeTypeCollection(new DetailLevelCodeType[] { DetailLevelCodeType.ReturnAll }); api.Execute(); //check whether the call is success. Assert.IsTrue(api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning, "do not success!"); ItemTypeCollection events = api.ApiResponse.ItemArray; // Make sure it covers that item that I just added. ItemType foundEvent = findItem(events, TestData.NewItem.ItemID); Assert.IsNotNull(foundEvent); }
public void GetSellerEvents() { Assert.IsNotNull(TestData.NewItem, "Failed because no item available -- requires successful AddItem test"); GetSellerEventsCall api = new GetSellerEventsCall(this.apiContext); // Time filter System.DateTime calFrom = System.DateTime.Now.AddHours(-1); System.DateTime calTo = System.DateTime.Now.AddHours(1); TimeFilter tf = new TimeFilter(calFrom, calTo); api.EndTimeFilter = tf; // Make API call. api.Execute(); }
private void BtnGetSellerEvents_Click(object sender, System.EventArgs e) { try { LstEvents.Items.Clear(); GetSellerEventsCall apicall = new GetSellerEventsCall(Context); if (TxtUserId.Text.Length > 0) { apicall.UserID = TxtUserId.Text; } apicall.IncludeNewItem = ChkIncludeNew.Checked; if (OptModTime.Checked == true) { apicall.ModTimeFilter = new TimeFilter(DatePickModFrom.Value, DatePickModTo.Value); } else if (OptStartTime.Checked == true) { apicall.StartTimeFilter = new TimeFilter(DatePickStartFrom.Value, DatePickStartTo.Value); } else if (OptEndTime.Checked == true) { apicall.EndTimeFilter = new TimeFilter(DatePickEndFrom.Value, DatePickEndTo.Value); } apicall.Execute(); foreach (ItemType evt in apicall.ItemEventList) { string[] listparams = new string[5]; listparams[0] = evt.ItemID; listparams[1] = evt.Title; listparams[2] = evt.SellingStatus.CurrentPrice.Value.ToString(); listparams[3] = evt.SellingStatus.QuantitySold.ToString(); listparams[4] = evt.SellingStatus.BidCount.ToString(); ListViewItem vi = new ListViewItem(listparams); LstEvents.Items.Add(vi); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }