コード例 #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);
        }
コード例 #2
0
ファイル: tstCustomerCollection.cs プロジェクト: kenny348/rtt
        public void ReportByFullNameOK()
        {
            //filters the record using the Full Name

            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            FilteredCustomers.ReportByFullName("XXX XXX");
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
コード例 #3
0
ファイル: CustomerList.aspx.cs プロジェクト: kenny348/rtt
    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();
    }
コード例 #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);
        }
コード例 #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();
    }
コード例 #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);
        }
コード例 #7
0
ファイル: CustomerList.aspx.cs プロジェクト: AndronY/Skeleton
    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();
    }
コード例 #8
0
ファイル: CustomerList.aspx.cs プロジェクト: AndronY/Skeleton
    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();
    }
コード例 #9
0
ファイル: tstCustomerCollection.cs プロジェクト: kenny348/rtt
        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);
            }
        }