public void FilterByProductNameNoneFound() { clsStockCollection AllStock = new clsStockCollection(); clsStockCollection FilteredStocks = new clsStockCollection(); FilteredStocks.FilterByProductName("xxxxxxxxxx"); Assert.AreEqual(0, FilteredStocks.Count); }
public void FilterByProductNameMethodOK() { clsStockCollection AllStock = new clsStockCollection(); clsStockCollection FilteredStocks = new clsStockCollection(); FilteredStocks.FilterByProductName(""); Assert.AreEqual(AllStock.Count, FilteredStocks.Count); }
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(); }
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); }