public void FilterByAddressOK() { clsCustomerCollection AllCustomers = new clsCustomerCollection(); clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); FilteredCustomers.FilterByAddress(""); Assert.AreEqual(AllCustomers.Count, FilteredCustomers.Count); }
public void FilterByAddressNoneFound() { clsCustomerCollection AllCustomers = new clsCustomerCollection(); clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); FilteredCustomers.FilterByAddress("TESTING"); Assert.AreEqual(0, 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(); }
public void FilterByAddressTestDataFound() { clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); bool OK = true; FilteredCustomers.FilterByAddress("Random"); if (FilteredCustomers.Count >= 1) { if (FilteredCustomers.CustomerList[0].Customer_id != 1) { OK = false; } } else { OK = false; } Assert.IsTrue(OK); }