Пример #1
0
        public void UpdateProfileColors_Test()
        {
            AccountRequestOptions requestOptions = new AccountRequestOptions();
            requestOptions.Add(AccountRequestOptionNames.ProfileBackgroundColor, newColor);
            requestOptions.Add(AccountRequestOptionNames.ProfileLinkColor, newColor);
            requestOptions.Add(AccountRequestOptionNames.ProfileSidebarBorderColor, newColor);
            requestOptions.Add(AccountRequestOptionNames.ProfileSidebarFillColor, newColor);
            requestOptions.Add(AccountRequestOptionNames.ProfileTextColor, newColor);

            IUser user = twitter.UpdateProfileColors(requestOptions);

            Assert.IsNotNull(user);
            Assert.AreEqual(newColor, user.ProfileBackgroundColor);
            Assert.AreEqual(newColor, user.ProfileLinkColor);
            Assert.AreEqual(newColor, user.ProfileSidebarBorderColor);
            Assert.AreEqual(newColor, user.ProfileSidebarFillColor);
            Assert.AreEqual(newColor, user.ProfileTextColor);

            //Reset environment
            requestOptions = new AccountRequestOptions();
            requestOptions.Add(AccountRequestOptionNames.ProfileBackgroundColor, defaultBackgroundColor);
            requestOptions.Add(AccountRequestOptionNames.ProfileLinkColor, defaultLinkColor);
            requestOptions.Add(AccountRequestOptionNames.ProfileSidebarBorderColor, defaultSidebarBorderColor);
            requestOptions.Add(AccountRequestOptionNames.ProfileSidebarFillColor, defaultSidebarFillColor);
            requestOptions.Add(AccountRequestOptionNames.ProfileTextColor, defaultTextColor);

            Assert.IsNotNull(twitter.UpdateProfileColors(requestOptions));
        }
Пример #2
0
        public void UpdateProfileInfo_Test()
        {
            AccountRequestOptions requestOptions = new AccountRequestOptions();
            requestOptions.Add(AccountRequestOptionNames.Description, newProfileInfo);
            //Twitter automatically puts "http://" in front of website so, accounting for that
            requestOptions.Add(AccountRequestOptionNames.Website, "http://" + newProfileInfo);
            requestOptions.Add(AccountRequestOptionNames.Location, newProfileInfo);
            IUser user = twitter.UpdateProfileInfo(requestOptions);

            Assert.IsNotNull(user);
            Assert.AreEqual(newProfileInfo, user.Description);
            //Again, Twitter automatically puts "http://" in front of website so, accounting for that
            Assert.AreEqual("http://" + newProfileInfo, user.Website);
            Assert.AreEqual(newProfileInfo, user.Location);

            //Reset environment
            requestOptions = new AccountRequestOptions();
            requestOptions.Add(AccountRequestOptionNames.Description, defaultDescription);
            requestOptions.Add(AccountRequestOptionNames.Website, defaultWebsite);
            requestOptions.Add(AccountRequestOptionNames.Location, defaultLocation);

            Assert.IsNotNull(twitter.UpdateProfileInfo(requestOptions));
        }