コード例 #1
0
        public void TestGetAllAuctionsForAnyResult()
        {
            ISurplusAuctionData wiSurplusAuctionData = new WisconsinAuctionData();

            IEnumerable <Auction> auctions = wiSurplusAuctionData.GetAllAuctions(false, false, null);

            Assert.IsTrue(auctions.Any());
        }
コード例 #2
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                if (!chkGetFirstRow.Checked)
                {
                    //TODO: Add a loop here to get ALL auction data classes
                    ISurplusAuctionData auctionData;
                    auctionData = new WisconsinAuctionData();

                    List <Auction> auctions = auctionData.GetAllAuctions(chkIncludeImages.Checked, chkIncludeEnded.Checked, backgroundWorker1).ToList();
                    foreach (Auction auction in auctions)
                    {
                        foreach (AuctionItem item in auction.AuctionItems)
                        {
                            auctionItems.Add(item);
                        }
                    }
                }
                else
                {
                    List <Auction> auctions = SurplusAuctionData_Test.GetAllAuctions(chkIncludeImages.Checked, chkIncludeEnded.Checked, backgroundWorker1, txtTestURL.Text).ToList();
                    foreach (Auction auction in auctions)
                    {
                        foreach (AuctionItem item in auction.AuctionItems)
                        {
                            auctionItems.Add(item);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " " + ex.StackTrace, "Exception Encountered", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }