Esempio n. 1
0
        public void FilterByProductNameNoneFound()
        {
            clsStockCollection AllStock       = new clsStockCollection();
            clsStockCollection FilteredStocks = new clsStockCollection();

            FilteredStocks.FilterByProductName("xxxxxxxxxx");
            Assert.AreEqual(0, FilteredStocks.Count);
        }
Esempio n. 2
0
        public void FilterByProductNameMethodOK()
        {
            clsStockCollection AllStock       = new clsStockCollection();
            clsStockCollection FilteredStocks = new clsStockCollection();

            FilteredStocks.FilterByProductName("");
            Assert.AreEqual(AllStock.Count, FilteredStocks.Count);
        }
Esempio n. 3
0
    protected void btnApply_Click(object sender, EventArgs e)
    {
        clsStockCollection Stocks = new clsStockCollection();

        Stocks.FilterByProductName(txtFilter.Text);
        lstStock.DataSource     = Stocks.StockList;
        lstStock.DataValueField = "ProductId";
        lstStock.DataTextField  = "ProductName";
        lstStock.DataBind();
    }
Esempio n. 4
0
        public void FilterByProductNameTestDataFound()
        {
            clsStockCollection FilteredStocks = new clsStockCollection();
            Boolean            OK             = true;

            FilteredStocks.FilterByProductName("aa");
            if (FilteredStocks.Count == 1)
            {
                if (FilteredStocks.StockList[0].StaffId != 1)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }