public void Convert_WithTwoTwitterStatuses_ShouldReturnTwoResults() { List <TwitterStatus> twitterStatuses = Builder <TwitterStatus> .CreateListOfSize(2) .WhereAll() .Have(ts => ts.User = Builder <TwitterUser> .CreateNew().Build()) .Build() .ToList(); IEnumerable <NGTweeterStatus> result = _tweeterStatusAdapter.Convert(twitterStatuses); Assert.AreEqual(2, result.Count()); VerifyListResults(result.ToList(), twitterStatuses); }
public GetTweetResponse GetTweetsOnPublicTimeline() { TwitterService service = new TwitterService(); IEnumerable <TwitterStatus> tweets = service.ListTweetsOnPublicTimeline(); TweeterStatusAdapter adapter = new TweeterStatusAdapter(); return(new GetTweetResponse { TweeterStatuses = adapter.Convert(tweets) }); }
public GetTweetResponse GetTweetsMentioningMe(OAuthAccessToken access) { _twitterService.AuthenticateWith(access.Token, access.TokenSecret); IEnumerable <TwitterStatus> tweets = _twitterService.ListTweetsMentioningMe(); TweeterStatusAdapter adapter = new TweeterStatusAdapter(); return(new GetTweetResponse { TweeterStatuses = adapter.Convert(tweets) }); }
public GetTweetResponse GetTweets(OAuthAccessToken access) { _twitterService.AuthenticateWith(access.Token, access.TokenSecret); IEnumerable <TwitterStatus> tweets = _twitterService.ListTweetsOnHomeTimeline(INITIAL_TWEETS_COUNT); TweeterStatusAdapter adapter = new TweeterStatusAdapter(); return(new GetTweetResponse { TweeterStatuses = adapter.Convert(tweets) }); }
public SendTweetResponse SendTweet(SendTweetRequest request) { _twitterService.AuthenticateWith(request.AccessToken.Token, request.AccessToken.TokenSecret); TwitterStatus twitterStatus = _twitterService.SendTweet(request.Status); TweeterStatusAdapter tweeterStatusAdapter = new TweeterStatusAdapter(); SendTweetResponse response = new SendTweetResponse { TweeterStatus = tweeterStatusAdapter.Convert(twitterStatus) }; return(response); }
public GetTweetResponse GetTweetsSince(GetTweetsRequest request) { OAuthAccessToken accessToken = request.AccessToken; _twitterService.AuthenticateWith(accessToken.Token, accessToken.TokenSecret); IEnumerable <TwitterStatus> tweets = _twitterService.ListTweetsOnHomeTimelineSince(request.LastTweetId); TweeterStatusAdapter adapter = new TweeterStatusAdapter(); return(new GetTweetResponse { TweeterStatuses = adapter.Convert(tweets) }); }