Esempio n. 1
0
        public void ReportByNameMethodOK()
        {
            clsCostumerCollection AllCostumers     = new clsCostumerCollection();
            clsCostumerCollection FilteredCostumer = new clsCostumerCollection();

            FilteredCostumer.ReportByName("");
            Assert.AreEqual(AllCostumer.Count, FilteredCostumer.Count);
        }
    protected void btnApply_Click(object sender, EventArgs e)
    {
        clsCostumerCollection CostumerList = new clsCostumerCollection();

        CostumerList.ReportByName(txtfilter.Text);
        lstCostumerList.DataSource     = StaffList.StaffList;
        lstCostumerList.DataValueField = "CostumerID";
        lstCostumerList.DataValueField = "Name";
        lstCostumerList.DataBind();
    }
    protected void btnClear_Click(object sender, EventArgs e)
    {
        clsCostumerCollection CostumerList = new clsCostumerCollection();

        CostumerList.ReportByName("");
        txtfilter.Text                 = "";
        lstCostumerList.DataSource     = CostumerList.CostumerList;
        lstCostumerList.DataValueField = "CostumerID";
        lstCostumerList.DataValueField = "Name";
        lstCostumerList.DataBind();
    }
Esempio n. 4
0
        public void ReportByNameTestDataFoundOK()
        {
            clsCostumerCollection FilteredCostumer = new clsCostumerCollection();
            Boolean OK = true;

            FilteredCostumer.ReportByName("James Smith");
            if (FilteredCostumer.Count == 1)
            {
                if (FilteredCostumer.CostumerList[0].ID != 1)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }