public void TestFindFirstName() { List <Contact> result = _contactOrganizerSqlRepository.FindContacts("James", null, null, null, 0, 1, "", out int totalNumber); Assert.AreEqual(1, totalNumber); Assert.AreEqual(1, result.Count); }
/// <summary> /// Returns a list of contacts that satisfy the search criteria. Includes results that contain the criteria string. Case insensitive. /// </summary> /// <param name="firstName">First name to search for.</param> /// <param name="lastName">Last name to search for.</param> /// <param name="telephoneNumber">Telephone number to search for.</param> /// <param name="address">Address to search for.</param> /// <param name="takeFrom">Contact result row number to start list from. Useful in paginations. </param> /// <param name="count">Number of contacts to retreive.</param> /// <param name="sortExpression">Contact property to order results by. Accepts values: FirstName, LastName, TelephoneNumber, FullAddress.</param> /// <param name="totalNumber">Returns total number of contacts in the organizer.</param> /// <returns></returns> public List <Contact> FindContacts(string firstName, string lastName, string telephoneNumber, string address, int takeFrom, int count, string sortExpression, out int totalNumber) { return(_contactOrganizerRepository.FindContacts(firstName, lastName, telephoneNumber, address, takeFrom, count, sortExpression, out totalNumber)); }