Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public void ReportByProductIdOK()
        {
            clsOrderLineCollection AllOrderLines    = new clsOrderLineCollection();
            clsOrderLineCollection FilterOrderLines = new clsOrderLineCollection();

            FilterOrderLines.ReportByProductId("");
            Assert.AreEqual(AllOrderLines.Count, FilterOrderLines.Count);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
    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();
    }
Esempio n. 5
0
    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();
    }