コード例 #1
0
        // 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);
        }
コード例 #2
0
        // 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));
        }
コード例 #3
0
        private void InitData()
        {
            _expectedQuery  = TestHelper.GenerateString();
            _expectedResult = GetQueryResult <IEnumerable <ITweetDTO> >(_expectedQuery);

            _fakeHomeTimelineParameters      = A.Fake <IHomeTimelineParameters>();
            _fakeUserTimelineQueryParameters = A.Fake <IUserTimelineQueryParameters>();
            _fakeMentionsTimelineParameters  = A.Fake <IMentionsTimelineParameters>();
        }
コード例 #4
0
        public IEnumerable<ITweet> GetHomeTimeline(IHomeTimelineParameters parameters)
        {
            if (parameters == null)
            {
                parameters = _timelineQueryParameterGenerator.CreateHomeTimelineParameters();
            }

            var timelineDTO = _timelineQueryExecutor.GetHomeTimeline(parameters);
            return _tweetFactory.GenerateTweetsFromDTO(timelineDTO);
        }
コード例 #5
0
        public IEnumerable <ITweet> GetHomeTimeline(IHomeTimelineParameters parameters)
        {
            if (parameters == null)
            {
                parameters = _timelineQueryParameterGenerator.CreateHomeTimelineParameters();
            }

            var timelineDTO = _timelineQueryExecutor.GetHomeTimeline(parameters);

            return(_tweetFactory.GenerateTweetsFromDTO(timelineDTO));
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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;
        }
コード例 #9
0
        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;
        }
コード例 #10
0
ファイル: TimelineAsync.cs プロジェクト: SowaLabs/Tweetinvi
 public static async Task <IEnumerable <ITweet> > GetHomeTimeline(IHomeTimelineParameters timelineParameters)
 {
     return(await Sync.ExecuteTaskAsync(() => Timeline.GetHomeTimeline(timelineParameters)));
 }
コード例 #11
0
 public IEnumerable <ITweet> GetHomeTimeline(IHomeTimelineParameters timelineRequestParameters)
 {
     return(ExecuteAuthenticatedUserOperation(() => _timelineController.GetHomeTimeline(timelineRequestParameters)));
 }
コード例 #12
0
 public async Task <IEnumerable <ITweet> > GetHomeTimelineAsync(IHomeTimelineParameters timelineRequestParameters)
 {
     return(await ExecuteAuthenticatedUserOperation(() => _taskFactory.ExecuteTaskAsync(() => GetHomeTimeline(timelineRequestParameters))));
 }
コード例 #13
0
        // Home Timeline
        public IEnumerable <ITweetDTO> GetHomeTimeline(IHomeTimelineParameters timelineParameters)
        {
            string query = _timelineQueryGenerator.GetHomeTimelineQuery(timelineParameters);

            return(_twitterAccessor.ExecuteGETQuery <IEnumerable <ITweetDTO> >(query));
        }
コード例 #14
0
 public string GetHomeTimeline(IHomeTimelineParameters timelineParameters)
 {
     string query = _timelineQueryGenerator.GetHomeTimelineQuery(timelineParameters);
     return _twitterAccessor.ExecuteJsonGETQuery(query);
 }
コード例 #15
0
 private string GenerateHomeTimelineParameters(IHomeTimelineParameters timelineParameters)
 {
     return _timelineQueryParameterGenerator.GenerateExcludeRepliesParameter(timelineParameters.ExcludeReplies);
 }
コード例 #16
0
ファイル: Timeline.cs プロジェクト: SowaLabs/TweetinviNew
 /// <summary>
 /// Get the tweets visible on the authenticated user timeline.
 /// </summary>
 public static IEnumerable<ITweet> GetHomeTimeline(IHomeTimelineParameters homeTimelineParameters)
 {
     return TimelineController.GetHomeTimeline(homeTimelineParameters);
 }
コード例 #17
0
 // Home Timeline
 public IEnumerable<ITweetDTO> GetHomeTimeline(IHomeTimelineParameters timelineParameters)
 {
     string query = _timelineQueryGenerator.GetHomeTimelineQuery(timelineParameters);
     return _twitterAccessor.ExecuteGETQuery<IEnumerable<ITweetDTO>>(query);
 }
コード例 #18
0
ファイル: Timeline.cs プロジェクト: mexicanlocos/tweetinvi
 /// <summary>
 /// Get the tweets visible on the logged in user Timeline
 /// </summary>
 public static IEnumerable <ITweet> GetHomeTimeline(IHomeTimelineParameters homeTimelineParameters)
 {
     return(TimelineController.GetHomeTimeline(homeTimelineParameters));
 }
コード例 #19
0
 private string GenerateHomeTimelineParameters(IHomeTimelineParameters timelineParameters)
 {
     return(_timelineQueryParameterGenerator.GenerateExcludeRepliesParameter(timelineParameters.ExcludeReplies));
 }
コード例 #20
0
ファイル: TimelineJson.cs プロジェクト: SowaLabs/Tweetinvi
 public static string GetHomeTimeline(IHomeTimelineParameters timelineParameters)
 {
     return(TimelineJsonController.GetHomeTimeline(timelineParameters));
 }
コード例 #21
0
 public static async Task<IEnumerable<ITweet>> GetHomeTimeline(IHomeTimelineParameters timelineParameters)
 {
     return await Sync.ExecuteTaskAsync(() => Timeline.GetHomeTimeline(timelineParameters));
 }
コード例 #22
0
 public static string GetHomeTimeline(IHomeTimelineParameters timelineParameters)
 {
     return TimelineJsonController.GetHomeTimeline(timelineParameters);
 }
コード例 #23
0
        public string GetHomeTimeline(IHomeTimelineParameters timelineParameters)
        {
            string query = _timelineQueryGenerator.GetHomeTimelineQuery(timelineParameters);

            return(_twitterAccessor.ExecuteGETQueryReturningJson(query));
        }