public void FilterByEmailAddressTestDataFound() { //Create an instance of the filtered data clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); //Variable to store outcome Boolean OK = true; //Apply a first name that doesn't exist FilteredCustomers.FilterByEmailAddress("*****@*****.**"); //Check that the correct number of records are found if (FilteredCustomers.Count == 1) { //Check that the first record is ID 1 if (FilteredCustomers.CustomerList[0].CustomerID != 1) { OK = false; } } else { OK = false; } //Test to see that there are no records Assert.IsTrue(OK); }
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); }
public void FilterByEmailAddressMethodOK() { //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.FilterByEmailAddress(""); //Test to see that the teo values are the same Assert.AreEqual(AllCustomers.Count, FilteredCustomers.Count); }