public void ReportByProductIdTestDataFound() { clsOrderLineCollection FilteredOrderLines = new clsOrderLineCollection(); //var to store the outcome Boolean OK = true; //apply a shipping method that doesn't exist FilteredOrderLines.ReportByProductId("yyy yyy"); //check that the correct number of records are found if (FilteredOrderLines.Count == 2) { //check that the first record is ID 1 if (FilteredOrderLines.OrderLineList[0].OrderId != 1) { OK = false; } //check that the first record is ID 2 if (FilteredOrderLines.OrderLineList[1].OrderId != 2) { OK = false; } } else { OK = false; } //test to see that there are no records Assert.IsTrue(OK); }
public void ReportByProductIdOK() { clsOrderLineCollection AllOrderLines = new clsOrderLineCollection(); clsOrderLineCollection FilterOrderLines = new clsOrderLineCollection(); FilterOrderLines.ReportByProductId(""); Assert.AreEqual(AllOrderLines.Count, FilterOrderLines.Count); }
public void ReportByProductIdFound() { //create an instance of the filtered data clsOrderLineCollection FilteredOrderLines = new clsOrderLineCollection(); //apply a shipping method that doesnt exist FilteredOrderLines.ReportByProductId("xxx xxx"); //test to see that there are no records Assert.AreEqual(0, FilteredOrderLines.Count); }
protected void btnClear_Click(object sender, EventArgs e) { clsOrderLineCollection OrderLines = new clsOrderLineCollection(); OrderLines.ReportByProductId(""); txtFilter.Text = ""; lstOrderList.DataSource = OrderLines.OrderLineList; lstOrderList.DataValueField = "OrderId"; lstOrderList.DataTextField = "ProductId"; lstOrderList.DataBind(); }
protected void btnApply_Click(object sender, EventArgs e) { clsOrderLineCollection OrderLines = new clsOrderLineCollection(); OrderLines.ReportByProductId(txtFilter.Text); lstOrderList.DataSource = OrderLines.OrderLineList; //set the name of the primary key lstOrderList.DataValueField = "OrderId"; //set the name of the field to display lstOrderList.DataTextField = "ProductId"; //bind the data to the list lstOrderList.DataBind(); }