예제 #1
0
        public void ReportByProductCodeNoneFound()
        {
            clsOrderCollection AllOrders      = new clsOrderCollection();
            clsOrderCollection FilteredOrders = new clsOrderCollection();

            FilteredOrders.ReportByProductCode("xxxxxxx");
            Assert.AreEqual(0, FilteredOrders.Count);
        }
예제 #2
0
        public void ReportByProductCodeMethodOK()
        {
            clsOrderCollection AllOrders      = new clsOrderCollection();
            clsOrderCollection FilteredOrders = new clsOrderCollection();

            FilteredOrders.ReportByProductCode("");
            Assert.AreEqual(AllOrders.Count, FilteredOrders.Count);
        }
예제 #3
0
    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();
    }
예제 #4
0
        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);
        }