public void ReportByTypeDataFound() { clsProductCollection FilteredProducts = new clsProductCollection(); Boolean OK = true; FilteredProducts.ReportByType("Cape"); if (FilteredProducts.Count == 2) { if (FilteredProducts.ProductsList[0].Product_ID != 1) { OK = false; } if (FilteredProducts.ProductsList[1].Product_ID != 9) { OK = false; } } else { OK = false; } Assert.IsTrue(OK); }
public void ReportByTypeNoneFound() { clsProductCollection FilteredProducts = new clsProductCollection(); FilteredProducts.ReportByType("Jeff"); Assert.AreEqual(0, FilteredProducts.Count); }
public void ReportByTypeMethodOK() { clsProductCollection AllProducts = new clsProductCollection(); clsProductCollection FilteredProducts = new clsProductCollection(); FilteredProducts.ReportByType(""); Assert.AreEqual(AllProducts.Count, FilteredProducts.Count); }
protected void BtnApply_Click(object sender, EventArgs e) { clsProductCollection Products = new clsProductCollection(); Products.ReportByType(TxtType.Text); LstProductList.DataSource = Products.ProductsList; LstProductList.DataTextField = "Type"; LstProductList.DataBind(); }