Ejemplo n.º 1
0
        public void ReportByFullNameTestDataFound()
        {
            //create an instance of the filtered data
            clsCustomerCollection FilteredCustomer = new clsCustomerCollection();
            //var to store outcome
            Boolean OK = true;

            //apply a full name that doesnt exist
            FilteredCustomer.ReportByFullName("yyy yyy");
            //check that the correct number of records are found
            if (FilteredCustomer.Count == 2)
            {
                //check that the first record is ID 7
                if (FilteredCustomer.CustomerList[0].ID != 7)
                {
                    OK = false;
                }
                //check that the first record is ID 8
                if (FilteredCustomer.CustomerList[1].ID != 8)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            //test to see that there are no records
            Assert.IsTrue(OK);
        }
Ejemplo n.º 2
0
        public void ReportByFullNameOK()
        {
            //filters the record using the Full Name

            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            FilteredCustomers.ReportByFullName("XXX XXX");
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
Ejemplo n.º 3
0
    protected void btnApply_Click(object sender, EventArgs e)
    {
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.ReportByFullName(txtFilter.Text);
        lstCustomerList.DataSource     = Customers.CustomerList;
        lstCustomerList.DataValueField = "ProductNo";
        lstCustomerList.DataTextField  = "FullName";
        lstCustomerList.DataBind();
    }
Ejemplo n.º 4
0
        public void RepostByFullNameNoneFound()
        {
            //create an instance of the filtered data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //apply a post code that doesnt exist
            FilteredCustomers.ReportByFullName("XXX XXX");
            //test to see that there are no records
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
Ejemplo n.º 5
0
    protected void btnClear_Click(object sender, EventArgs e)
    {
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.ReportByFullName("");
        txtFilter.Text                 = "";
        lstCustomerList.DataSource     = Customers.CustomerList;
        lstCustomerList.DataValueField = "CustomerID";
        lstCustomerList.DataTextField  = "FullName";
        lstCustomerList.DataBind();
    }
Ejemplo n.º 6
0
        public void ReportByFullNameMethodOK()
        {
            //create an instance of the class containing unfiltered results
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //create an instance of the filtered data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //apply a blank string (should return all records);
            FilteredCustomers.ReportByFullName("");
            //test to see that the two values are the same
            Assert.AreEqual(AllCustomers.Count, FilteredCustomers.Count);
        }
Ejemplo n.º 7
0
    protected void btnApply_Click(object sender, EventArgs e)
    {
        //create an instance of the customer collection
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.ReportByFullName(txtFilter.Text);
        lstCustomerList.DataSource = Customers.CustomerList;
        //set the name of the primary key
        lstCustomerList.DataValueField = "ID";
        //set the name of the field to display
        lstCustomerList.DataTextField = "FullName";
        //bind the data to the list
        lstCustomerList.DataBind();
    }
Ejemplo n.º 8
0
    protected void btnClear_Click(object sender, EventArgs e)
    {
        //create an instance of the customer collection
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.ReportByFullName("");
        //clear any existing filter to tidy up the interface
        txtFilter.Text             = "";
        lstCustomerList.DataSource = Customers.CustomerList;
        //set the name of the primary key
        lstCustomerList.DataValueField = "ID";
        //set the name of the field to display
        lstCustomerList.DataTextField = "FullName";
        //bind the data to the list
        lstCustomerList.DataBind();
    }
Ejemplo n.º 9
0
        public void ReportByFullNameTestDataFound()
        {
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();
            Boolean OK = true;

            FilteredCustomers.ReportByFullName("XXX XXX");
            if (FilteredCustomers.Count == 2)
            {
                if (FilteredCustomers.CustomerList[1].ProductNo != 2)
                {
                    OK = false;
                }
                if (FilteredCustomers.CustomerList[2].ProductNo != 3)
                {
                    OK = false;
                }
                else
                {
                    OK = false;
                }
                Assert.IsTrue(OK);
            }
        }