public void ReportByProductCodeNoneFound() { clsOrderCollection AllOrders = new clsOrderCollection(); clsOrderCollection FilteredOrders = new clsOrderCollection(); FilteredOrders.ReportByProductCode("xxxxxxx"); Assert.AreEqual(0, FilteredOrders.Count); }
public void ReportByProductCodeMethodOK() { clsOrderCollection AllOrders = new clsOrderCollection(); clsOrderCollection FilteredOrders = new clsOrderCollection(); FilteredOrders.ReportByProductCode(""); Assert.AreEqual(AllOrders.Count, FilteredOrders.Count); }
protected void btnApply_Click(object sender, EventArgs e) { clsOrderCollection Orders = new clsOrderCollection(); Orders.ReportByProductCode(txtFilter.Text); lstOrdersList.DataSource = Orders.OrdersList; lstOrdersList.DataValueField = "OrderId"; lstOrdersList.DataTextField = "ProductCode"; lstOrdersList.DataBind(); }
public void ReportByProductCodeTestDataFound() { clsOrderCollection FilteredOrders = new clsOrderCollection(); Boolean OK = true; FilteredOrders.ReportByProductCode("YYY4321"); if (FilteredOrders.Count == 2) { if (FilteredOrders.OrdersList[0].OrderId != 155) { OK = false; } if (FilteredOrders.OrdersList[1].OrderId != 156) { OK = false; } } else { OK = false; } Assert.IsTrue(OK); }