public void FilterByCustomerFirstNameOKTestDataFound() { //create instance of the filtered data clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); //var to store outcome Boolean OK = true; //apply a First Name that doesnt exist FilteredCustomers.FilterByCustomerFirstName("uheruhgereruhe"); //chek that the correct number of record are found if (FilteredCustomers.count == 2) { if (FilteredCustomers.CustomerList[0].CustomerID != 4) { OK = false; } //check that the first reecord is Id 5 if (FilteredCustomers.CustomerList[1].CustomerID != 5) { OK = false; } } else { OK = false; } //test to see there are no records Assert.IsFalse(OK); }
public void FilterByCustomerFirstNameOKNoneFound() { //create an instance of the filtered data clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); //aply a first name that doestn exist FilteredCustomers.FilterByCustomerFirstName("Seeya"); //test to see that there are no records Assert.AreEqual(0, FilteredCustomers.count); }
public void FilterByCustomerFirstNameOK(string CustomerFirstName) { //Create an instance of the class clsCustomerCollection AllCustomers = new clsCustomerCollection(); //create an instance of the filtered data clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); //apply a blank string {(should return all records) FilteredCustomers.FilterByCustomerFirstName(""); //test to see that the two values are the same Assert.AreEqual(AllCustomers.count, FilteredCustomers.count); }