public void IsRetweet_ShoulBeTrue_WhenRetweetStatusIsNotNullTest() { NGTweeterStatus tweeterStatus = new NGTweeterStatus { CreatedDate = DateTime.Today, Id = 101, RetweetedStatus = new NGTweeterStatus { CreatedDate = DateTime.Today, Id = 102, Tweet = "Original Tweet", User = new NGTweeterUser { Id = 5, Name = "Nilesh", ProfileImageUrl = "Nilesh.jpg", ScreenName = "NileshGule" } }, User = new NGTweeterUser { Id = 6, Name = "TestName", ProfileImageUrl = "Test.jpg", ScreenName = "TestScreenName" } }; _viewModel = new TweetViewModel(tweeterStatus); Assert.IsTrue(_viewModel.IsRetweet); }
public void ScreenName_ShoulBeFormattedWithOriginalUserScreenName_WhenRetweetStatusIsNotNullTest() { NGTweeterStatus tweeterStatus = new NGTweeterStatus { CreatedDate = DateTime.Today, Id = 101, RetweetedStatus = new NGTweeterStatus { CreatedDate = DateTime.Today, Id = 102, Tweet = "Original Tweet", User = new NGTweeterUser { Id = 5, Name = "Nilesh", ProfileImageUrl = "Nilesh.jpg", ScreenName = "NileshGule" } }, User = new NGTweeterUser { Id = 6, Name = "TestName", ProfileImageUrl = "Test.jpg", ScreenName = "TestScreenName" } }; _viewModel = new TweetViewModel(tweeterStatus); Assert.AreEqual("NileshGule, (RT by TestScreenName)", _viewModel.ScreenName); }
public void Convert_WithSingleTwitterStatuses_ShouldReturnSingleResults() { TwitterStatus twitterStatus = Builder <TwitterStatus> .CreateNew().With(ts => ts.User = Builder <TwitterUser> .CreateNew().Build()) .Build(); NGTweeterStatus result = _tweeterStatusAdapter.Convert(twitterStatus); VerifyResults(result, twitterStatus); }
private void AddNewTweet(NGTweeterStatus newTweet) { if (newTweet.RetweetedStatus == null) { _tweeterStatusViewModels.Insert(0, new TweetViewModel(newTweet)); } else { _tweeterStatusViewModels.Insert(0, new RetweetViewModel(newTweet)); } }
internal void ReTweetExistingTweet(NGTweeterStatus tweet) { IsBusy = true; RetweetRequest retweetRequest = new RetweetRequest { AccessToken = (OAuthAccessToken)_applicationSettingsProvider["accessToken"], TweetId = tweet.Id }; _authenticationService.BeginRetweet(retweetRequest, RetweetCallback, null); }
public TweetViewModel(NGTweeterStatus tweeterStatus) { TweeterStatus = tweeterStatus; RetweetCommand = new RelayCommand(OnRetweet); _refreshTimer = new DispatcherTimer { Interval = TimeSpan.FromMinutes(1) }; _refreshTimer.Tick += (o, args) => RaisePropertyChanged("CreatedDate"); _refreshTimer.Start(); }
public void ScreenName_ShouldReturnOnlyUsersScreenName_WhenRetweetStatusIsNullTest() { NGTweeterStatus tweeterStatus = new NGTweeterStatus { CreatedDate = DateTime.Today, Id = 102, Tweet = "Original Tweet", User = new NGTweeterUser { Id = 5, Name = "Nilesh", ProfileImageUrl = "Nilesh.jpg", ScreenName = "NileshGule" } }; _viewModel = new TweetViewModel(tweeterStatus); Assert.AreEqual("NileshGule", _viewModel.ScreenName); }
public RetweetViewModel(NGTweeterStatus tweeterStatus) : base(tweeterStatus) { }
private static void VerifyResults(NGTweeterStatus adaptedStatus, TwitterStatus twitterStatus) { Assert.AreEqual(twitterStatus.Text, adaptedStatus.Tweet); Assert.AreEqual(twitterStatus.CreatedDate.AddHours(8), adaptedStatus.CreatedDate); }