示例#1
0
        public void DeleteAccountWithoutContentTests()
        {
            UserInfo           user = CreateUserWithVerifiedEmailAddress();
            DiscussionPostTest post = new DiscussionPostTest();

            post.SetUp();
            WebDiscussionService.TransitDiscussionPost t_post = post.GetTransitInstance();
            t_post.AccountId = user.id;
            t_post.Id        = post.EndPoint.CreateOrUpdateDiscussionPost(user.ticket, t_post);
            Console.WriteLine("Post: {0}", t_post.Id);
            int count1 = post.EndPoint.GetDiscussionPostsCount(GetAdminTicket(), t_post.DiscussionId);

            EndPoint.DeleteAccount(GetAdminTicket(), user.id);
            // deleting a user with default options doesn't delete all his posts
            int count2 = post.EndPoint.GetDiscussionPostsCount(GetAdminTicket(), t_post.DiscussionId);

            Assert.AreEqual(count1, count2);
            post.TearDown();
        }
示例#2
0
        public void DeleteAccountWithContentTests()
        {
            UserInfo user = CreateUserWithVerifiedEmailAddress();
            // create a post
            DiscussionPostTest post = new DiscussionPostTest();

            post.SetUp();
            WebDiscussionService.TransitDiscussionPost t_post = post.GetTransitInstance();
            t_post.AccountId = user.id;
            t_post.Id        = post.EndPoint.CreateOrUpdateDiscussionPost(user.ticket, t_post);
            Console.WriteLine("Post: {0}", t_post.Id);
            int count1 = post.EndPoint.GetDiscussionPostsCount(GetAdminTicket(), t_post.DiscussionId);

            WebAccountService.TransitAccountDeleteOptions options = new WebAccountService.TransitAccountDeleteOptions();
            options.DeleteContent = true;
            EndPoint.DeleteAccountWithOptions(GetAdminTicket(), user.id, options);
            // deleting a user with content
            int count2 = post.EndPoint.GetDiscussionPostsCount(GetAdminTicket(), t_post.DiscussionId);

            Assert.AreEqual(count1 - 1, count2);
            post.TearDown();
        }