Example #1
0
        public void ReportByCustomerAddressNoneFound()
        {
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            FilteredCustomers.ReportByCustomerAddress("xxx xxx");
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
Example #2
0
        public void ReportByCustomerAddressTestDataFound()
        {
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            Boolean OK = true;

            FilteredCustomers.ReportByCustomerAddress("yyy yyy");

            if (FilteredCustomers.Count == 2)
            {
                //check that the first record is ID 36
                if (FilteredCustomers.CustomerList[0].CustomerID != 36)
                {
                    OK = false;
                }
                //check that the first record is ID 37
                if (FilteredCustomers.CustomerList[1].CustomerID != 37)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            //test to see that there are no records
            Assert.IsTrue(OK);
        }
Example #3
0
        public void ReportByCustomerAddressMethodOK()
        {
            clsCustomerCollection AllCustomers      = new clsCustomerCollection();
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            FilteredCustomers.ReportByCustomerAddress("");
            Assert.AreEqual(AllCustomers.Count, FilteredCustomers.Count);
        }
Example #4
0
    protected void btnClear_Click(object sender, EventArgs e)
    {
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.ReportByCustomerAddress("");
        lstCustomerList.DataSource     = Customers.CustomerList;
        lstCustomerList.DataValueField = "CustomerID";
        lstCustomerList.DataTextField  = "CustomerAddress";
        lstCustomerList.DataBind();
    }