Example #1
0
        public void SelectionChangedWhenEventSet()
        {
            var status = new Status();
            _event.Object.Publish(status);

            Assert.That(_selection.SelectedTweet, Is.SameAs(status));
        }
Example #2
0
        public void SetUp()
        {
            status = new Status();
            user = status.User = new User();

            vm = new TweetViewModel(status);
        }
Example #3
0
        public void SinceIdFromNonLocal()
        {
            Status oldStatus = new Status {Id = 12345};

            var args = GetArgs(from t in this._source where t.Id >= oldStatus.Id select t);

            Assert.That(args.SinceId, Is.EqualTo(12345));
        }
Example #4
0
        public IEnumerable<Status> GetOlder(Status status)
        {
            long olderThanId = status.Id;
            var statuses = (from s in _queryable where s.Id <= olderThanId select s).ToArray();
            if (statuses.First().Id == status.Id)
            {
                return statuses.Skip(1);
            }

            return statuses;
        }
Example #5
0
        public void QueryTweetById()
        {
            var status = new Status {Id = 123456};
            _api.Setup(a => a.GetStatus("123456")).Returns(status);

            var tweets = from tweet in _twitter.FriendsTimeLine
                        where tweet.Id == 123456
                        select tweet;

            Assert.That(tweets.First().Id, Is.EqualTo(123456));
        }
Example #6
0
        public IEnumerable<Status> GetNewer(Status status)
        {
            long newerThanId = status.Id;
            var statuses =
                (from s in _queryable where s.Id >= newerThanId select s).
                    ToArray();

            if (statuses.Any() && statuses.Last().Id == status.Id)
            {
                return statuses.Take(statuses.Count() - 1);
            }

            return statuses;
        }
        public void SetsUrl()
        {
            var status = new Status()
                {
                    User = new User()
                        {
                            Name = "ewwser",
                        },
                    Id = 123456
                };

            _selection.Setup(s => s.SelectedTweet).Returns(status);

            _cmd.Execute(null);

            _service.Verify(s => s.SetUrl("http://twitter.com/ewwser/status/123456"));
        }
Example #8
0
 public TweetViewModel(Status status)
 {
     this._status = status;
 }