protected void RunSearchTest( Func <RedditSearchCriteria, RedditSearchCriteria> criteriaFunc, Action <GenericCollectionAssertions <RedditSearchResult> > assertAction = null, Action <RedditSearchResult[]> additionalResultsAction = null) { var results = _redditSearchService.GetResultsAsync(criteriaFunc).GetAwaiter().GetResult(); assertAction?.Invoke(results.Should()); additionalResultsAction?.Invoke(results); }
public static async Task <RedditSearchResult[]> GetResultsAsync(this IRedditSearchService service, RedditSearchCriteria criteria) { return(await service.GetResultsAsync(criteria.GetQueryString())); }
public static async Task <RedditSearchResult[]> GetResultsAsync(this IRedditSearchService service, Func <RedditSearchCriteria, RedditSearchCriteria> criteriaFunc) { var criteria = criteriaFunc(new RedditSearchCriteria()); return(await service.GetResultsAsync(criteria)); }