public void FilterByFirstNameTestDataFound() { //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.FilterByFirstName("Scrambert"); //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 FilterByFirstNameNoneFound() { //Create an instance of the filtered data clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); //Apply a first name that doesn't exist FilteredCustomers.FilterByFirstName("Scrambert"); //Check to see that there are no records Assert.AreEqual(0, FilteredCustomers.Count); }
public void FilterByFirstNameMethodOK() { //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.FilterByFirstName(""); //Test to see that the teo values are the same Assert.AreEqual(AllCustomers.Count, FilteredCustomers.Count); }