Inheritance: ITwitterResponse
Exemplo n.º 1
0
        public void Created_ForUserUsingTestTime_IsPopulated()
        {
            // arrange
            var directMessage = new User();
            directMessage.CreatedDate = "Sun Mar 18 06:42:26 +0000 2007";

            // act
            var dateTime = directMessage.Created;

            Assert.That(dateTime.DayOfWeek == DayOfWeek.Sunday);
            Assert.That(dateTime.Year == 2007);
        }
        public static void UpdateContactWithTwitterUser(this TwitterContact contact, User user,
                                                        DateTime? updateTimestamp)
        {
            if (user == null || contact == null)
                return;

            contact.FullName = user.Name;
            contact.Bio = user.Description;
            contact.Followers = user.FollowersCount;
            contact.Following = user.FriendsCount;

            var imageUri = new Uri(user.ProfileImageUrl);
            if (contact.ImageUrl != imageUri)
            {
                contact.SetContactImage(imageUri, updateTimestamp);
            }
        }