Example #1
0
        public void ReportByBookNameNoneFound()
        {
            clsStockCollection FilteredStock = new clsStockCollection();

            FilteredStock.ReportByBookName("xxxxx");
            Assert.AreEqual(0, FilteredStock.Count);
        }
Example #2
0
        public void ReportByBookNameNoneFound()
        {
            clsStockCollection filteredStock = new clsStockCollection();

            filteredStock.ReportByBookName("This book doesn't exist");
            Assert.AreEqual(0, filteredStock.Count);
        }
Example #3
0
        public void ReportByBookNameMethodOK()
        {
            clsStockCollection AllStock      = new clsStockCollection();
            clsStockCollection FilteredStock = new clsStockCollection();

            FilteredStock.ReportByBookName("");
            Assert.AreEqual(AllStock.Count, FilteredStock.Count);
        }
Example #4
0
        public void ReportByBookNameOK()
        {
            clsStockCollection allStock      = new clsStockCollection();
            clsStockCollection filteredStock = new clsStockCollection();

            filteredStock.ReportByBookName("");
            Assert.AreEqual(allStock.Count, filteredStock.Count);
        }
Example #5
0
    protected void btnApply_Click(object sender, EventArgs e)
    {
        clsStockCollection Books = new clsStockCollection();

        Books.ReportByBookName(txtBookName.Text);
        lstStockList.DataSource     = Books.StockList;
        lstStockList.DataValueField = "StockID";
        lstStockList.DataTextField  = "BookName";
        lstStockList.DataBind();
    }
Example #6
0
    protected void btnClear_Click(object sender, EventArgs e)
    {
        clsStockCollection Stock = new clsStockCollection();

        Stock.ReportByBookName("");
        txtFilter.Text              = "";
        lstStockList.DataSource     = Stock.StockList;
        lstStockList.DataValueField = "BookID";
        lstStockList.DataTextField  = "BookName";
        lstStockList.DataBind();
    }
Example #7
0
        public void ReportByBookNameTestDataFound()
        {
            clsStockCollection FilteredStock = new clsStockCollection();
            Boolean            OK            = true;

            FilteredStock.ReportByBookName("Harry Potter and the Deathly Hallows");
            if (FilteredStock.Count == 2)
            {
                if (FilteredStock.StockList[0].BookID != 9780545010221)
                {
                    OK = false;
                }
                if (FilteredStock.StockList[1].BookID != 9780545010221)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Example #8
0
        public void ReportByBookNameTestDataFound()
        {
            clsStockCollection filteredStock = new clsStockCollection();
            Boolean            OK            = true;

            filteredStock.ReportByBookName("Going");
            if (filteredStock.Count == 2)
            {
                if (filteredStock.StockList[0].StockID != 7)
                {
                    OK = false;
                }
                if (filteredStock.StockList[1].StockID != 14)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }