public void ReportByAvailabilityOK() { //create an instance of clsStockCollection containing no filter clsStockCollection AllStock = new clsStockCollection(); //create an instance of filtered data clsStockCollection FilteredStock = new clsStockCollection(); //apply true value (will be different from original list) FilteredStock.ReportByAvailability(true); //test to see two values are not the same Assert.AreNotEqual(AllStock.Count, FilteredStock.Count); }
protected void btnInStock_Click(object sender, EventArgs e) { //create an instance of clsStockCollection clsStockCollection Stock = new clsStockCollection(); Stock.ReportByAvailability(true); lstStock.DataSource = Stock.StockList; //set name of primary key lstStock.DataValueField = "ItemId"; //set name of field to display lstStock.DataTextField = "ItemName"; //bind data to the list lstStock.DataBind(); }