예제 #1
0
        public void GetNextTwentyTweetsFromUserIdShouldReturnObservableContainerThatContainsInvalidTwitterID()
        {
            var tv = new TwitterViewModel();
            tv.UpdateTweets("____INVALID");

            Assert.IsTrue(tv.Tweets.First().text == "Invalid TwitterID.");
        }
예제 #2
0
        public void ShouldGetNextTwentyTweetsFromUserId()
        {
            var tv = new TwitterViewModel();
            tv.UpdateTweets("RealTimeWWII");

            Assert.IsTrue(tv.Tweets.Count == 20);
        }
        public void Init()
        {
            var tweets = new ObservableCollection<Tweet>()
                             {
                                 new Tweet
                                     {
                                         created_at = "1/1/2012",
                                         entities = new TwitterUserEntities
                                                        {
                                                            media = new List<TwitterUserMedia>()
                                                                        {
                                                                            new TwitterUserMedia
                                                                                {
                                                                                    media_url = "http://www.google.com/google.jpg"
                                                                                },
                                                                        },
                                                        },

                                         text = "Tweet from RealTimeWWII",
                                         user = new TwitterUser
                                                    {
                                                        screen_name = "RealTimeWWII",
                                                        name = "Real Tweets From WWII",
                                                        profile_image_url = "http://www.twitter.com/twitter.jpg"
                                                    },
                                     }
                             };

            _mock = MockRepository.GenerateMock<ITwitterService>();
            _mock.Stub(s => s.GetNextTwentyTweetsFromUserId("RealTimeWWII")).Return(tweets);

            _tvm = new TwitterViewModel(_mock);
        }