public void ReportByPhoneNoTestDataFound() { //create an instance of the filtered data clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); //var to store the outcome Boolean OK = true; //apply a phone no tha doesnt exist FilteredCustomers.ReportByPhoneNo("yyyyyyyyyyy"); //check that the correct number of records are found if (FilteredCustomers.Count == 2) { //check to see the first record id 4 if (FilteredCustomers.CustomerList[0].CustomerNo != 4) { OK = false; } //check that the first recors ID is 5 if (FilteredCustomers.CustomerList[1].CustomerNo != 5) { OK = false; } } else { OK = false; } //test to see that there are no records Assert.IsTrue(OK); }
public void ReportByPhoneNoNoneFound() { //create an instance of filtered data clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); //apply a blank string (Should return all records) FilteredCustomers.ReportByPhoneNo("12345678910"); //test to see there are no records Assert.AreEqual(0, FilteredCustomers.Count); }
public void ReportByPhoneNoMethodOK() { //create an instance of the class we want to create clsCustomerCollection AllCustomers = new clsCustomerCollection(); //create an instance of filtered data clsCustomerCollection FilteredCustomers = new clsCustomerCollection(); //apply a blank string (Should return all records) FilteredCustomers.ReportByPhoneNo(""); //test to see the two vales are the same Assert.AreNotEqual(AllCustomers.Count, FilteredCustomers.Count); }