public void ReportByShippingMethodTestDataFound()
        {
            clsOrderCollection FilteredOrders = new clsOrderCollection();
            //var to store the outcome
            Boolean OK = true;

            //apply a shipping method that doesn't exist
            FilteredOrders.ReportByShippingMethod("yyy yyy");
            //check that the correct number of records are found
            if (FilteredOrders.Count == 2)
            {
                //check that the first record is ID 1
                if (FilteredOrders.OrderList[0].OrderId != 1)
                {
                    OK = false;
                }
                //check that the first record is ID 2
                if (FilteredOrders.OrderList[1].OrderId != 2)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            //test to see that there are no records
            Assert.IsTrue(OK);
        }
        public void ReportByShippingMethodMethodOK()
        {
            clsOrderCollection AllOrders    = new clsOrderCollection();
            clsOrderCollection FilterOrders = new clsOrderCollection();

            FilterOrders.ReportByShippingMethod("");
            Assert.AreEqual(AllOrders.Count, FilterOrders.Count);
        }
        public void ReportByShippingMethodNoneFound()
        {
            //create an instance of the filtered data
            clsOrderCollection FilteredOrders = new clsOrderCollection();

            //apply a shipping method that doesnt exist
            FilteredOrders.ReportByShippingMethod("xxx xxx");
            //test to see that there are no records
            Assert.AreEqual(0, FilteredOrders.Count);
        }
    protected void btnClear_Click(object sender, EventArgs e)
    {
        clsOrderCollection Orders = new clsOrderCollection();

        Orders.ReportByShippingMethod("");
        txtFilter.Text              = "";
        lstOrderList.DataSource     = Orders.OrderList;
        lstOrderList.DataValueField = "OrderId";
        lstOrderList.DataTextField  = "ShippingMethod";
        lstOrderList.DataBind();
    }
    protected void btnApply_Click(object sender, EventArgs e)
    {
        clsOrderCollection Orders = new clsOrderCollection();

        Orders.ReportByShippingMethod(txtFilter.Text);
        lstOrderList.DataSource = Orders.OrderList;
        //set the name of the primary key
        lstOrderList.DataValueField = "OrderId";
        //set the name of the field to display
        lstOrderList.DataTextField = "ShippingMethod";
        //bind the data to the list
        lstOrderList.DataBind();
    }