public void SendTweet_ShouldUpdateTheUserStatus_AndReturnNewTweeterStatusTest() { OAuthAccessToken accessToken = new OAuthAccessToken { Token = "abcd", TokenSecret = "A@c#" }; Mock.Get(_mockTwitterService).Setup(mockService => mockService.AuthenticateWith(accessToken.Token, accessToken.TokenSecret)); SendTweetRequest request = new SendTweetRequest { AccessToken = accessToken, Status = "Hello World" }; TwitterStatus twitterStatusStatus = Builder <TwitterStatus> .CreateNew() .With(x => x.Text = request.Status) .With(x => x.User = Builder <TwitterUser> .CreateNew().Build()) .Build(); Mock.Get(_mockTwitterService).Setup(mockService => mockService.SendTweet(request.Status)).Returns(twitterStatusStatus); SendTweetResponse sendTweetResponse = _authenticationService.SendTweet(request); Assert.IsNotNull(sendTweetResponse); Assert.AreSame(request.Status, sendTweetResponse.TweeterStatus.Tweet); }
public TweetResponse SendTweet(SendTweetRequest tweet) { Console.WriteLine("In TweetService.SendTweet"); return(new TweetResponse { Message = "SendTweet" }); }
internal void OnTweetActionCommand() { IsBusy = true; SendTweetRequest sendTweetRequest = new SendTweetRequest { AccessToken = (OAuthAccessToken)_applicationSettingsProvider["accessToken"], Status = TweetText }; _authenticationService.BeginSendTweet(sendTweetRequest, SendTweetCallback, null); }
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); }