// Helper // Home Timeline public string GetHomeTimelineQuery(IHomeTimelineParameters timelineParameters) { var homeTimelineRequestQueryParameter = GenerateHomeTimelineParameters(timelineParameters); var includeContributorDetailsQueryParameter = GenerateIncludeContributorsDetailsParameter(timelineParameters.IncludeContributorDetails); var timelineRequestQueryParameter = GenerateTimelineRequestParameter(timelineParameters); var requestParameters = string.Format("{0}{1}{2}", homeTimelineRequestQueryParameter, includeContributorDetailsQueryParameter, timelineRequestQueryParameter); return string.Format(Resources.Timeline_GetHomeTimeline, requestParameters); }
// Helper // Home Timeline public string GetHomeTimelineQuery(IHomeTimelineParameters timelineParameters) { var homeTimelineRequestQueryParameter = GenerateHomeTimelineParameters(timelineParameters); var includeContributorDetailsQueryParameter = GenerateIncludeContributorsDetailsParameter(timelineParameters.IncludeContributorDetails); var timelineRequestQueryParameter = GenerateTimelineRequestParameter(timelineParameters); var requestParameters = string.Format("{0}{1}{2}", homeTimelineRequestQueryParameter, includeContributorDetailsQueryParameter, timelineRequestQueryParameter); return(string.Format(Resources.Timeline_GetHomeTimeline, requestParameters)); }
private void InitData() { _expectedQuery = TestHelper.GenerateString(); _expectedResult = GetQueryResult <IEnumerable <ITweetDTO> >(_expectedQuery); _fakeHomeTimelineParameters = A.Fake <IHomeTimelineParameters>(); _fakeUserTimelineQueryParameters = A.Fake <IUserTimelineQueryParameters>(); _fakeMentionsTimelineParameters = A.Fake <IMentionsTimelineParameters>(); }
public IEnumerable<ITweet> GetHomeTimeline(IHomeTimelineParameters parameters) { if (parameters == null) { parameters = _timelineQueryParameterGenerator.CreateHomeTimelineParameters(); } var timelineDTO = _timelineQueryExecutor.GetHomeTimeline(parameters); return _tweetFactory.GenerateTweetsFromDTO(timelineDTO); }
public IEnumerable <ITweet> GetHomeTimeline(IHomeTimelineParameters parameters) { if (parameters == null) { parameters = _timelineQueryParameterGenerator.CreateHomeTimelineParameters(); } var timelineDTO = _timelineQueryExecutor.GetHomeTimeline(parameters); return(_tweetFactory.GenerateTweetsFromDTO(timelineDTO)); }
private void Init() { _maximumNumberOfTweetsParameterValue = TestHelper.GenerateRandomInt(); _fakeUserIdentifier = A.Fake<IUserIdentifier>(); _fakeHomeTimelineParameters = A.Fake<IHomeTimelineParameters>(); _fakeHomeTimelineParameters.CallsTo(x => x.MaximumNumberOfTweetsToRetrieve).Returns(_maximumNumberOfTweetsParameterValue); _fakeUserTimelineParameters = A.Fake<IUserTimelineParameters>(); _fakeUserTimelineParameters.CallsTo(x => x.MaximumNumberOfTweetsToRetrieve).Returns(_maximumNumberOfTweetsParameterValue); _fakeUserTimelineQueryParameters = A.Fake<IUserTimelineQueryParameters>(); _fakeUserTimelineQueryParameters.CallsTo(x => x.Parameters).Returns(_fakeUserTimelineParameters); _fakeUserTimelineQueryParameters.CallsTo(x => x.UserIdentifier).Returns(_fakeUserIdentifier); _fakeMentionsTimelineParameters = A.Fake<IMentionsTimelineParameters>(); _fakeMentionsTimelineParameters.CallsTo(x => x.MaximumNumberOfTweetsToRetrieve).Returns(_maximumNumberOfTweetsParameterValue); _userIdentifierParameter = TestHelper.GenerateString(); _includeRTSParameter = TestHelper.GenerateString(); _excludeRepliesParameter = TestHelper.GenerateString(); _includeContributorDetailsParameter = TestHelper.GenerateString(); _maximumNumberOfTweetsParameter = TestHelper.GenerateString(); _trimUserParameter = TestHelper.GenerateString(); _sinceIdParameter = TestHelper.GenerateString(); _maxIdParameter = TestHelper.GenerateString(); _includeDetailsParameter = TestHelper.GenerateString(); var queryParameterBuilder = new StringBuilder(); queryParameterBuilder.Append(_includeContributorDetailsParameter); queryParameterBuilder.Append(_maximumNumberOfTweetsParameter); queryParameterBuilder.Append(_trimUserParameter); queryParameterBuilder.Append(_sinceIdParameter); queryParameterBuilder.Append(_maxIdParameter); queryParameterBuilder.Append(_includeDetailsParameter); var homeQueryParameter = _excludeRepliesParameter + queryParameterBuilder; var userQueryParameter = _userIdentifierParameter + _includeRTSParameter + _excludeRepliesParameter + queryParameterBuilder; _expectedTimelineQuery = String.Format(Resources.Timeline_GetHomeTimeline, homeQueryParameter); _expectedUserTimelineQuery = String.Format(Resources.Timeline_GetUserTimeline, userQueryParameter); _expectedMentionsTimelineQuery = String.Format(Resources.Timeline_GetMentionsTimeline, queryParameterBuilder); }
private void Init() { _maximumNumberOfTweetsParameterValue = TestHelper.GenerateRandomInt(); _fakeUserIdentifier = A.Fake <IUserIdentifier>(); _fakeHomeTimelineParameters = A.Fake <IHomeTimelineParameters>(); _fakeHomeTimelineParameters.CallsTo(x => x.MaximumNumberOfTweetsToRetrieve).Returns(_maximumNumberOfTweetsParameterValue); _fakeUserTimelineParameters = A.Fake <IUserTimelineParameters>(); _fakeUserTimelineParameters.CallsTo(x => x.MaximumNumberOfTweetsToRetrieve).Returns(_maximumNumberOfTweetsParameterValue); _fakeUserTimelineQueryParameters = A.Fake <IUserTimelineQueryParameters>(); _fakeUserTimelineQueryParameters.CallsTo(x => x.Parameters).Returns(_fakeUserTimelineParameters); _fakeUserTimelineQueryParameters.CallsTo(x => x.UserIdentifier).Returns(_fakeUserIdentifier); _fakeMentionsTimelineParameters = A.Fake <IMentionsTimelineParameters>(); _fakeMentionsTimelineParameters.CallsTo(x => x.MaximumNumberOfTweetsToRetrieve).Returns(_maximumNumberOfTweetsParameterValue); _userIdentifierParameter = TestHelper.GenerateString(); _includeRTSParameter = TestHelper.GenerateString(); _excludeRepliesParameter = TestHelper.GenerateString(); _includeContributorDetailsParameter = TestHelper.GenerateString(); _maximumNumberOfTweetsParameter = TestHelper.GenerateString(); _trimUserParameter = TestHelper.GenerateString(); _sinceIdParameter = TestHelper.GenerateString(); _maxIdParameter = TestHelper.GenerateString(); _includeDetailsParameter = TestHelper.GenerateString(); var queryParameterBuilder = new StringBuilder(); queryParameterBuilder.Append(_includeContributorDetailsParameter); queryParameterBuilder.Append(_maximumNumberOfTweetsParameter); queryParameterBuilder.Append(_trimUserParameter); queryParameterBuilder.Append(_sinceIdParameter); queryParameterBuilder.Append(_maxIdParameter); queryParameterBuilder.Append(_includeDetailsParameter); var homeQueryParameter = _excludeRepliesParameter + queryParameterBuilder; var userQueryParameter = _userIdentifierParameter + _includeRTSParameter + _excludeRepliesParameter + queryParameterBuilder; _expectedTimelineQuery = string.Format(Resources.Timeline_GetHomeTimeline, homeQueryParameter); _expectedUserTimelineQuery = string.Format(Resources.Timeline_GetUserTimeline, userQueryParameter); _expectedMentionsTimelineQuery = string.Format(Resources.Timeline_GetMentionsTimeline, queryParameterBuilder); }
private void InitData() { _fakeHomeTimelineParameters = A.Fake <IHomeTimelineParameters>(); _fakeUserTimelineParameters = A.Fake <IUserTimelineParameters>(); _fakeMentionsTimelineParameters = A.Fake <IMentionsTimelineParameters>(); _fakeUserTimelineQueryParameters = A.Fake <IUserTimelineQueryParameters>(); _maximuNumberOfTweets = TestHelper.GenerateRandomInt(); _resultDTO = new List <ITweetDTO>(); _result = new List <ITweet>(); _userName = TestHelper.GenerateString(); _userId = TestHelper.GenerateRandomLong(); _fakeUser = A.Fake <IUser>(); _fakeUserDTO = A.Fake <IUserDTO>(); _fakeUserIdentifier = _fakeUserDTO; }
private void InitData() { _fakeHomeTimelineParameters = A.Fake<IHomeTimelineParameters>(); _fakeUserTimelineParameters = A.Fake<IUserTimelineParameters>(); _fakeMentionsTimelineParameters = A.Fake<IMentionsTimelineParameters>(); _fakeUserTimelineQueryParameters = A.Fake<IUserTimelineQueryParameters>(); _maximuNumberOfTweets = TestHelper.GenerateRandomInt(); _resultDTO = new List<ITweetDTO>(); _result = new List<ITweet>(); _userName = TestHelper.GenerateString(); _userId = TestHelper.GenerateRandomLong(); _fakeUser = A.Fake<IUser>(); _fakeUserDTO = A.Fake<IUserDTO>(); _fakeUserIdentifier = _fakeUserDTO; }
public static async Task <IEnumerable <ITweet> > GetHomeTimeline(IHomeTimelineParameters timelineParameters) { return(await Sync.ExecuteTaskAsync(() => Timeline.GetHomeTimeline(timelineParameters))); }
public IEnumerable <ITweet> GetHomeTimeline(IHomeTimelineParameters timelineRequestParameters) { return(ExecuteAuthenticatedUserOperation(() => _timelineController.GetHomeTimeline(timelineRequestParameters))); }
public async Task <IEnumerable <ITweet> > GetHomeTimelineAsync(IHomeTimelineParameters timelineRequestParameters) { return(await ExecuteAuthenticatedUserOperation(() => _taskFactory.ExecuteTaskAsync(() => GetHomeTimeline(timelineRequestParameters)))); }
// Home Timeline public IEnumerable <ITweetDTO> GetHomeTimeline(IHomeTimelineParameters timelineParameters) { string query = _timelineQueryGenerator.GetHomeTimelineQuery(timelineParameters); return(_twitterAccessor.ExecuteGETQuery <IEnumerable <ITweetDTO> >(query)); }
public string GetHomeTimeline(IHomeTimelineParameters timelineParameters) { string query = _timelineQueryGenerator.GetHomeTimelineQuery(timelineParameters); return _twitterAccessor.ExecuteJsonGETQuery(query); }
private string GenerateHomeTimelineParameters(IHomeTimelineParameters timelineParameters) { return _timelineQueryParameterGenerator.GenerateExcludeRepliesParameter(timelineParameters.ExcludeReplies); }
/// <summary> /// Get the tweets visible on the authenticated user timeline. /// </summary> public static IEnumerable<ITweet> GetHomeTimeline(IHomeTimelineParameters homeTimelineParameters) { return TimelineController.GetHomeTimeline(homeTimelineParameters); }
// Home Timeline public IEnumerable<ITweetDTO> GetHomeTimeline(IHomeTimelineParameters timelineParameters) { string query = _timelineQueryGenerator.GetHomeTimelineQuery(timelineParameters); return _twitterAccessor.ExecuteGETQuery<IEnumerable<ITweetDTO>>(query); }
/// <summary> /// Get the tweets visible on the logged in user Timeline /// </summary> public static IEnumerable <ITweet> GetHomeTimeline(IHomeTimelineParameters homeTimelineParameters) { return(TimelineController.GetHomeTimeline(homeTimelineParameters)); }
private string GenerateHomeTimelineParameters(IHomeTimelineParameters timelineParameters) { return(_timelineQueryParameterGenerator.GenerateExcludeRepliesParameter(timelineParameters.ExcludeReplies)); }
public static string GetHomeTimeline(IHomeTimelineParameters timelineParameters) { return(TimelineJsonController.GetHomeTimeline(timelineParameters)); }
public static async Task<IEnumerable<ITweet>> GetHomeTimeline(IHomeTimelineParameters timelineParameters) { return await Sync.ExecuteTaskAsync(() => Timeline.GetHomeTimeline(timelineParameters)); }
public static string GetHomeTimeline(IHomeTimelineParameters timelineParameters) { return TimelineJsonController.GetHomeTimeline(timelineParameters); }
public string GetHomeTimeline(IHomeTimelineParameters timelineParameters) { string query = _timelineQueryGenerator.GetHomeTimelineQuery(timelineParameters); return(_twitterAccessor.ExecuteGETQueryReturningJson(query)); }