예제 #1
0
        public IEnumerable<IMention> GetMentionsTimeline(IMentionsTimelineParameters parameters)
        {
            if (parameters == null)
            {
                parameters = _timelineQueryParameterGenerator.CreateMentionsTimelineParameters();
            }

            var timelineDTO = _timelineQueryExecutor.GetMentionsTimeline(parameters);
            return _tweetFactory.GenerateMentionsFromDTO(timelineDTO);
        }
        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;
        }
예제 #3
0
 public string GetMentionsTimeline(IMentionsTimelineParameters timelineParameters)
 {
     var query = _timelineQueryGenerator.GetMentionsTimelineQuery(timelineParameters);
     return _twitterAccessor.ExecuteJsonGETQuery(query);
 }
        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);
        }
        // Mentions Timeline
        public string GetMentionsTimelineQuery(IMentionsTimelineParameters mentionsTimelineParameters)
        {
            var includeContributorDetailsQueryParameter = GenerateIncludeContributorsDetailsParameter(mentionsTimelineParameters.IncludeContributorDetails);
            var timelineRequestParameter = GenerateTimelineRequestParameter(mentionsTimelineParameters);
            var requestParameters = string.Format("{0}{1}", includeContributorDetailsQueryParameter, timelineRequestParameter);

            return string.Format(Resources.Timeline_GetMentionsTimeline, requestParameters);
        }
예제 #6
0
 public static async Task<IEnumerable<IMention>> GetMentionsTimeline(IMentionsTimelineParameters timelineParameters)
 {
     return await Sync.ExecuteTaskAsync(() => Timeline.GetMentionsTimeline(timelineParameters));
 }
예제 #7
0
 // Mention Timeline
 public IEnumerable<ITweetDTO> GetMentionsTimeline(IMentionsTimelineParameters timelineParameters)
 {
     string query = _timelineQueryGenerator.GetMentionsTimelineQuery(timelineParameters);
     return _twitterAccessor.ExecuteGETQuery<IEnumerable<ITweetDTO>>(query);
 }
예제 #8
0
 /// <summary>
 /// Get the tweets visible on your mentions timeline
 /// </summary>
 public static IEnumerable<IMention> GetMentionsTimeline(IMentionsTimelineParameters mentionsTimelineParameters)
 {
     return TimelineController.GetMentionsTimeline(mentionsTimelineParameters);
 }