Esempio n. 1
0
        public void ReportByNameMethodOK()
        {
            //create an instance of the classes we want to create
            clsCustomerCollection AllCustomers      = new clsCustomerCollection();
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            FilteredCustomers.ReportByName("");
            //test to see that it passes
            Assert.AreEqual(AllCustomers.Count, FilteredCustomers.Count);
        }
Esempio n. 2
0
        public void ReportByNameNoneFound()
        {
            //create an instance of the classes we want to create
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //non existing data created to see if it finds it
            FilteredCustomers.ReportByName("xxxxx xxxxx");
            //test to see that it passes
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
Esempio n. 3
0
    //function to delete the selected customer record
    void DeleteCustomer()
    {
        //create a new instance of the customer collection class
        clsCustomerCollection CustomerList = new clsCustomerCollection();

        //find the record to delete
        CustomerList.ThisCustomer.Find(CustomerID);
        //delete the record
        CustomerList.Delete();
    }
Esempio n. 4
0
        public void FilterBySurnameNoneFound()
        {
            //create an instance of the filtered data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //apply a post code that doesn't exist
            FilteredCustomers.FilterBySurname("a");
            //test to see that there are no records
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
        public void ReportByCustomerLastNameNoneFound()
        {
            //create an instance of the filtrered data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //apply a customer last name that doesn't exist
            FilteredCustomers.ReportByCustomerLastName("xxx xxx");
            //test to see that there are no records
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
Esempio n. 6
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.ThisCustomer.Find(CustomerId);

        Customers.Delete();

        Response.Redirect("CustomerList.aspx");
    }
Esempio n. 7
0
        public void ReportByEmailNotFound()
        {
            //create an instance of the filtered adata
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //apply a post code that doesnt exist
            FilteredCustomers.ReportByEmail("*****@*****.**");
            //test to see that there are no records
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
        public void ReportbyCustomerNameNoneFound()
        {
            //create an instance of the filtered data
            clsCustomerCollection FilteredCustomerName = new clsCustomerCollection();

            //test to see that the are no records;
            FilteredCustomerName.ReportByCustomerName("xxx xxx");
            //test to see that the two values are the same
            Assert.AreEqual(0, FilteredCustomerName.Count);
        }
Esempio n. 9
0
        public void ReportByPostCodeNoneFound()
        {
            //create an instance of the filtered data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //apply a blank string (should return all records)
            FilteredCustomers.ReportByPostCode("XXXX XXX");
            //test to see that the two values are the same
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
Esempio n. 10
0
        //ensures the count function is working
        public void CountCustomersOK()
        {
            clsCustomerCollection AllCustomers = new clsCustomerCollection();

            int Count = 7;

            AllCustomers.Count = Count;

            Assert.AreEqual(AllCustomers.Count, Count);
        }
Esempio n. 11
0
        public void ReportByNameMethodOk()
        {
            clsCustomerCollection AllCustomers = new clsCustomerCollection();

            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            FilteredCustomers.ReportByName("");

            Assert.AreEqual(AllCustomers.Count, FilteredCustomers.Count);
        }
    protected void btnAddressSearch_Click(object sender, EventArgs e)
    {
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.FilterByAddress(txtAddress.Text);
        lstCustomers.DataSource     = Customers.CustomerList;
        lstCustomers.DataValueField = "Customer_id";
        lstCustomers.DataTextField  = "Name";
        lstCustomers.DataBind();
    }
    protected void btnMarketingSearch_Click(object sender, EventArgs e)
    {
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.FilterByMarketingPreference(Convert.ToBoolean(lstPreference.Text));
        lstCustomers.DataSource     = Customers.CustomerList;
        lstCustomers.DataValueField = "Customer_id";
        lstCustomers.DataTextField  = "Name";
        lstCustomers.DataBind();
    }
    void DeleteCustomer()
    {
        //create a new instance of the customers
        clsCustomerCollection Customers = new clsCustomerCollection();

        //find the record to delete
        Customers.ThisCustomer.Find(CustomerNo);
        //delete the record
        Customers.Delete();
    }
        public void ReportByPhoneNoNoneFound()
        {
            //create an instance of filtered data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //apply a blank string (Should return all records)
            FilteredCustomers.ReportByPhoneNo("12345678910");
            //test to see there are no records
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
        public void ReportBySurnameNoneFound()
        {
            // Create an instance of the filtered data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            // Apply a surname that doesn't exist
            FilteredCustomers.ReportBySurname("XYZ");
            // Test to see that there are no records
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
        public void ReportByEmailNoneFound()
        {
            //instance of the filterd data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //apply apost code that dosent exist
            FilteredCustomers.ReportByEmail("xxxxxxxx");
            //test to see that the two values are the same
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
Esempio n. 18
0
    protected void btnApply_Click(object sender, EventArgs e)
    {
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.ReportByName(txtEnterName.Text);
        lstCustomerList.DataSource     = Customers.CustomerList;
        lstCustomerList.DataValueField = "CustomerId";
        lstCustomerList.DataTextField  = "Name";
        lstCustomerList.DataBind();
    }
        public void FilterByEmailAddressNoneFound()
        {
            //Create an instance of the filtered data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //Apply a first name that doesn't exist
            FilteredCustomers.FilterByEmailAddress("*****@*****.**");
            //Check to see that there are no records
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
Esempio n. 20
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();
    }
Esempio n. 21
0
        public void ReportByUsernameNoneFound()
        {
            //create an instance of the filtered data
            clsCustomerCollection FilteredUsernames = new clsCustomerCollection();

            //apply a username that doesnt exsit
            FilteredUsernames.ReportByUsername("xxxx");
            //test to see that there are no records
            Assert.AreEqual(0, FilteredUsernames.Count);
        }
        public void ReportByPostcodeNoneFound()
        {
            //create an instance of the clsCustomerCollection class
            clsCustomerCollection FilteredPostcodes = new clsCustomerCollection();

            //apply a postcode that doesnt exist
            FilteredPostcodes.ReportByPostcode("xxx xxx");
            //test to see that the two values are the same
            Assert.AreEqual(0, FilteredPostcodes.Count);
        }
        public void ReportBySurNameNoneFound()
        {
            //create an instance of the filtered data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            //apply a surname that doesn't exist
            FilteredCustomers.ReportBySurName("xxxxx");
            //test to see that the two values are the same
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
Esempio n. 24
0
        public void FilterByCustomerIdNoneFound()
        {
            //create an instance of the filtered data
            clsCustomerCollection FilteredCustomer = new clsCustomerCollection();

            //apply a blank string (should return all records);
            FilteredCustomer.FilterByCustomerID(0);
            //test to see that the two values are the same
            Assert.AreEqual(0, FilteredCustomer.Count);
        }
Esempio n. 25
0
        public void ReportByPostCodeNoneFound()
        {
            //create an instance of the class containing unfilitered results
            clsCustomerCollection data = new clsCustomerCollection();

            //use an email that doesn't exist
            data.ReportByEmail("[email protected]");
            //compare values
            Assert.AreEqual(0, data.Count);
        }
Esempio n. 26
0
        public void FilterbyeMailNoneFound()
        {
            //create an instance of the filtered data
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection(" ");

            //apply a blank string (should return all records)
            FilteredCustomers.Filterbyemail("xxx xxx");
            //test to see the two values are the same
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
        public void ReportByFirstNameNoneFound()
        {
            //create an instance of the class containing unfiltered results
            clsCustomerCollection FilteredCustomer = new clsCustomerCollection();

            //apply first name that doesn't exist
            FilteredCustomer.ReportByFirstName("N Faquir");
            //test to see that the two values are the same
            Assert.AreEqual(0, FilteredCustomer.Count);
        }
Esempio n. 28
0
    protected void btnClear_Click(object sender, EventArgs e)
    {
        clsCustomerCollection Customers = new clsCustomerCollection();

        Customers.ReportByName("");
        txtFilter.Text                 = "";
        lstCustomerList.DataSource     = Customers.CustomerList;
        lstCustomerList.DataValueField = "CustomerId";
        lstCustomerList.DataTextField  = "CustomerName";
        lstCustomerList.DataBind();
    }
Esempio n. 29
0
 public void ReportByEmailMethodOK()
 {
     //createa an instance of the calss contaion unfiltered results
     clsCustomerCollection AllCustomers = new clsCustomerCollection();
     //create an instance of the fultered data
     clsCustomerCollection FilteredCustomers = new clsCustomerCollection();
     //apply a blank string 
     FilteredCustomers.ReportByEmail("");
     //test to see that the two values are the same
     Assert.AreEqual(AllCustomers.Count, FilteredCustomers.Count);
 }
Esempio n. 30
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        //create new instance of customer collection class
        clsCustomerCollection CustomerBook = new clsCustomerCollection();

        CustomerBook.ThisCustomer.Find(CustomerId);
        //invoke the delete method
        CustomerBook.Delete();
        //redirect to customer list once confirmed
        Response.Redirect("CustomerList.aspx");
    }