public void ReportByOrderIDNoneFound() { // create instance of filtered data clsOrderLineCollection FilteredOrderLines = new clsOrderLineCollection(); // apply number plate that doesn't exist FilteredOrderLines.ReportbyOrderID(000000); // test that there are no records Assert.AreEqual(0, FilteredOrderLines.Count); }
public void ReportByOrderIDMethodOK() { // create instance of unfiltered class clsOrderLineCollection AllOrderLines = new clsOrderLineCollection(); // create instance of filtered orders clsOrderLineCollection FilteredOrderLines = new clsOrderLineCollection(); // apply blank string (all records returned) FilteredOrderLines.ReportbyOrderID(1); // test that values are the same Assert.AreEqual(AllOrderLines.Count, FilteredOrderLines.Count); }
protected void btnApply_Click(object sender, EventArgs e) { // create instance of orderLine collection clsOrderLineCollection OrderLines = new clsOrderLineCollection(); OrderLines.ReportbyOrderID(Convert.ToInt32(txtFilter.Text)); lstOrderLineList.DataSource = OrderLines.OrderLineList; //set primary key lstOrderLineList.DataValueField = "OrderLineID"; // set field to display lstOrderLineList.DataTextField = "OrderID"; // bind data to list lstOrderLineList.DataBind(); }