public void FilterByMarketingPreferenceOK() { clsCustomerCollection AllCustomers = new clsCustomerCollection(); clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); FilteredCustomers.FilterByMarketingPreference(false); Assert.AreEqual(1, FilteredCustomers.Count); }
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(); }