public static void ShowCreateAndDelete()
        {
            OAuthTokens tokens = Configuration.GetTokens();

            // See if the friendship exists (it should not)
            TwitterRelationship friendship = TwitterFriendship.Show(tokens, "rickydev").ResponseObject;

            // If it exists, delete it.
            if (friendship.Target.Following)
            {
                DeleteFriendship(tokens, friendship);
            }

            // Create the friendship
            TwitterUser followedUser = TwitterFriendship.Create(tokens, "rickydev").ResponseObject;

            Assert.IsNotNull(followedUser);

            // Get the friendship details (maybe again)
            friendship = TwitterFriendship.Show(tokens, "rickydev").ResponseObject;
            Assert.IsNotNull(friendship);
            Assert.IsNotNull(friendship.Target);

            // Delete the friendship (maybe again)
            DeleteFriendship(tokens, friendship);
        }
        private static void DeleteFriendship(OAuthTokens tokens, TwitterRelationship friendship)
        {
            TwitterUser unfollowedUser = friendship.Delete(tokens).ResponseObject;

            Assert.IsNotNull(unfollowedUser);
        }
Пример #3
0
        private static void DeleteFriendship(OAuthTokens tokens, TwitterRelationship friendship)
        {
            var unfollowedUser = friendship.Delete(tokens);

            Assert.IsNotNull(unfollowedUser.ResponseObject, unfollowedUser.ErrorMessage);
        }