public void ExactSearchBasedOnZip() { findCustomer.Zip = "98177"; findCustomerResult = findCustomer.Find(); CustomerResult[] result = findCustomerResult.GetResults(); Assert.AreEqual <int>(1, result.Length, "Should return 1 record with Zip as '98177'"); Assert.AreEqual <string>("Mary", result[0].FirstName, "The first record in the list should be 'Mary Andersen'"); Assert.AreEqual <string>("Andersen", result[0].LastName, "The first record in the list should be 'Mary Andersen'"); }
public void ExactSearchBasedOnCity() { findCustomer.City = "Bellevue"; findCustomerResult = findCustomer.Find(); CustomerResult[] result = findCustomerResult.GetResults(); Assert.AreEqual <int>(1, result.Length, "Should return 1 record with City as 'Bellevue'"); Assert.AreEqual <string>("Kari", result[0].FirstName, "The third record in the list should be 'Kari Hensien'"); Assert.AreEqual <string>("Hensien", result[0].LastName, "The third record in the list should be 'Kari Hensien'"); }
public void ExactSearchBasedOnCellNumber() { findCustomer.CellNumber = "7777777777"; findCustomerResult = findCustomer.Find(); CustomerResult[] result = findCustomerResult.GetResults(); Assert.AreEqual <int>(1, result.Length, "Should return 1 record with Mobile Phone as 777-777-7777"); Assert.AreEqual <string>("Mary", result[0].FirstName, "The first record in the list should be 'Mary Andersen'"); Assert.AreEqual <string>("Andersen", result[0].LastName, "The first record in the list should be 'Mary Andersen'"); }
public void ExactSearchBasedOnWorkNumber() { findCustomer.WorkNumber = "2222222222"; findCustomerResult = findCustomer.Find(); CustomerResult[] result = findCustomerResult.GetResults(); Assert.AreEqual <int>(1, result.Length, "Should return 1 record with WorkPhone as 222-222-2222"); Assert.AreEqual <string>("Leonids", result[0].FirstName, "The first record in the list should be 'Leonids Paturskis'"); Assert.AreEqual <string>("Paturskis", result[0].LastName, "The first record in the list should be 'Leonids Paturskis'"); }
public void ExactSearchBasedOnHomeNumber() { findCustomer.HomeNumber = "4444444444"; findCustomerResult = findCustomer.Find(); CustomerResult[] result = findCustomerResult.GetResults(); Assert.AreEqual <int>(1, result.Length, "Should return 1 record with HomePhone as 4444444444"); Assert.AreEqual <string>("Kari", result[0].FirstName, "The first record should have First Name as 'Kari'"); Assert.AreEqual <string>("Hensien", result[0].LastName, "The first record should have Last Name as 'Hensien'"); }
public void StartWithSearchBasedOnLastName() { findCustomer.LastName = "a"; findCustomerResult = findCustomer.Find(); CustomerResult[] result = findCustomerResult.GetResults(); Assert.AreEqual <int>(1, result.Length, "Should return 1 record for Last Name starting with 'a'"); Assert.AreEqual <string>("Mary", result[0].FirstName, "The first record in the list should be 'Mary Andersen'"); Assert.AreEqual <string>("Andersen", result[0].LastName, "The first record in the list should be 'Mary Andersen'"); }
public void SearchBasedOnMultipleCriteria() { findCustomer.FirstName = "Ma"; findCustomer.LastName = "An"; findCustomerResult = findCustomer.Find(); CustomerResult[] result = findCustomerResult.GetResults(); Assert.AreEqual <int>(1, result.Length, "Should return 1 record for First Name starting with 'Ma' and Last Name starting with 'An'"); Assert.AreEqual <string>("Mary", result[0].FirstName, "The first record in the list should be 'Mary Andersen'"); Assert.AreEqual <string>("Andersen", result[0].LastName, "The first record in the list should be 'Mary Andersen'"); }
public void StartWithSearchBasedOnStreet() { findCustomer.Street = "1"; findCustomerResult = findCustomer.Find(); CustomerResult[] result = findCustomerResult.GetResults(); Assert.AreEqual <int>(2, result.Length, "Should return 2 record for Street starting with '1'"); Assert.AreEqual <string>("Mary", result[0].FirstName, "The first record in the list should be 'Mary Andersen'"); Assert.AreEqual <string>("Andersen", result[0].LastName, "The first record in the list should be 'Mary Andersen'"); Assert.AreEqual <string>("Kari", result[1].FirstName, "The second record in the list should be 'Kari Hensien'"); Assert.AreEqual <string>("Hensien", result[1].LastName, "The second record in the list should be 'Kari Hensien'"); }
public void ExactSearchBasedOnState() { findCustomer.State = "WA"; findCustomerResult = findCustomer.Find(); CustomerResult[] result = findCustomerResult.GetResults(); Assert.AreEqual <int>(3, result.Length, "Should return 3 records with State as 'WA'"); Assert.AreEqual <string>("Leonids", result[0].FirstName, "The first record in the list should be 'Leonids Paturskis'"); Assert.AreEqual <string>("Paturskis", result[0].LastName, "The first record in the list should be 'Leonids Paturskis'"); Assert.AreEqual <string>("Mary", result[1].FirstName, "The second record in the list should be 'Mary Andersen'"); Assert.AreEqual <string>("Andersen", result[1].LastName, "The second record in the list should be 'Mary Andersen'"); Assert.AreEqual <string>("Kari", result[2].FirstName, "The third record in the list should be 'Kari Hensien'"); Assert.AreEqual <string>("Hensien", result[2].LastName, "The third record in the list should be 'Kari Hensien'"); }