/// <summary> /// Gets last 20 users /// </summary> /// <param name="search">Search string</param> /// <returns>TwitterUserInfo list</returns> public List <TwitterUserInfo> FindUsers(string search) { const int pageRowCount = 20; const int pageNumber = 0; try { Twitterizer.OAuthTokens tokens = GetOAuthTokens(); UserSearchOptions options = new UserSearchOptions(); options.Page = pageNumber; options.NumberPerPage = pageRowCount; TwitterResponse <TwitterUserCollection> userResponse = TwitterUser.Search(tokens, search, options); if (userResponse.Result == RequestResult.Success) { TwitterUserCollection collection = userResponse.ResponseObject; return(MapUsers(userResponse.ResponseObject)); } else { throw CreateException(userResponse.Result, userResponse.ErrorMessage); } } catch (Exception ex) { log.Error(ex); throw; } }
public static void Search() { OAuthTokens tokens = Configuration.GetTokens(); TwitterUserCollection results = TwitterUser.Search(tokens, "twit_er_izer").ResponseObject; Assert.IsNotNull(results); Assert.IsNotEmpty(results); }
public void Search() { OAuthTokens tokens = Configuration.GetTokens(); var response = TwitterUser.Search(tokens, "twit_er_izer"); Assert.IsNotNull(response.ResponseObject, response.ErrorMessage); Assert.AreNotEqual(0, response.ResponseObject.Count, response.ErrorMessage); }