public void DiscussionPostStickynessDiscussionOwnerTest()
        {
            WebDiscussionService.TransitDiscussion t_discussion = new WebDiscussionService.TransitDiscussion();
            t_discussion.Name        = GetNewString();
            t_discussion.Personal    = false;
            t_discussion.Description = GetNewString();
            t_discussion.Id          = EndPoint.CreateOrUpdateDiscussion(_user.ticket, t_discussion);
            // check that the discussion admin can create and flip the stickyness of the post
            WebDiscussionService.TransitDiscussionPost t_post = GetTransitInstance();
            t_post.DiscussionId = t_discussion.Id;
            t_post.AccountId    = _user.id;
            t_post.Id           = EndPoint.CreateOrUpdateDiscussionPost(_user.ticket, t_post);
            Console.WriteLine("Post: {0}", t_post.Id);
            WebDiscussionService.TransitDiscussionPost t_post_copy = EndPoint.GetDiscussionPostById(_user.ticket, t_post.Id);
            Assert.AreEqual(t_post.Id, t_post_copy.Id);
            Assert.AreEqual(false, t_post_copy.Sticky);
            Assert.AreEqual(t_post.Sticky, t_post_copy.Sticky);
            t_post.Sticky = true;
            // check that a regular user cannot flip the post stickyness
            UserInfo user = CreateUserWithVerifiedEmailAddress();

            try
            {
                EndPoint.CreateOrUpdateDiscussionPost(user.ticket, t_post);
                Assert.IsTrue(false, "Expected an access denied.");
            }
            catch (Exception ex)
            {
                Console.WriteLine("Expected exception: {0}", ex.Message);
                Assert.IsTrue(ex.Message.StartsWith("System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> SnCore.Services.ManagedAccount+AccessDeniedException: Access denied"));
            }
            // check the that discussion admin can
            t_post.Id   = EndPoint.CreateOrUpdateDiscussionPost(_user.ticket, t_post);
            t_post_copy = EndPoint.GetDiscussionPostById(_user.ticket, t_post.Id);
            Assert.AreEqual(t_post.Id, t_post_copy.Id);
            Assert.AreEqual(true, t_post_copy.Sticky);
            Assert.AreEqual(t_post.Sticky, t_post_copy.Sticky);
            t_post.Sticky = false;
            try
            {
                EndPoint.CreateOrUpdateDiscussionPost(user.ticket, t_post);
                Assert.IsTrue(false, "Expected an access denied.");
            }
            catch (Exception ex)
            {
                Console.WriteLine("Expected exception: {0}", ex.Message);
                Assert.IsTrue(ex.Message.StartsWith("System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> SnCore.Services.ManagedAccount+AccessDeniedException: Access denied"));
            }
            t_post.Id   = EndPoint.CreateOrUpdateDiscussionPost(_user.ticket, t_post);
            t_post_copy = EndPoint.GetDiscussionPostById(_user.ticket, t_post.Id);
            Assert.AreEqual(t_post.Id, t_post_copy.Id);
            Assert.AreEqual(false, t_post_copy.Sticky);
            Assert.AreEqual(t_post.Sticky, t_post_copy.Sticky);
            EndPoint.DeleteDiscussionPost(_user.ticket, t_post.Id);
            EndPoint.DeleteDiscussion(_user.ticket, t_discussion.Id);
            DeleteUser(user.id);
        }
        protected void GetOrCreateDiscussionIdTest <TransitType, WebServiceType>(
            string typename,
            WebServiceTest <TransitType, WebServiceType> objecttest)
            where WebServiceType : new()
        {
            // create a discussion

            Console.WriteLine("Type: {0}", typename);

            objecttest.SetUp();
            int objecttest_id = objecttest.Create(GetAdminTicket());

            Assert.IsTrue(objecttest_id > 0);

            int discussion_id = EndPoint.GetOrCreateDiscussionId(_user.ticket, typename, objecttest_id);

            Assert.IsTrue(discussion_id > 0);

            WebDiscussionService.TransitDiscussion t_discussion = EndPoint.GetDiscussionById(
                _user.ticket, discussion_id);

            Console.WriteLine("Discussion: {0}", t_discussion.Name);

            string redirecturi = EndPoint.GetDiscussionRedirectUri(_user.ticket, discussion_id);

            Console.WriteLine("Uri: {0}", redirecturi);

            Assert.AreEqual(t_discussion.ParentObjectUri, redirecturi);
            Assert.AreEqual(t_discussion.ParentObjectType, typename);

            Console.WriteLine("Parent name: {0}", t_discussion.ParentObjectName);

            // post to a discussion as a regular user
            WebDiscussionService.TransitDiscussionPost t_post = new WebDiscussionService.TransitDiscussionPost();
            t_post.DiscussionId = discussion_id;
            t_post.AccountId    = _user.id;
            t_post.Body         = GetNewString();
            t_post.Subject      = GetNewString();
            t_post.Id           = EndPoint.CreateOrUpdateDiscussionPost(_user.ticket, t_post);

            objecttest.Delete(GetAdminTicket(), objecttest_id);
            objecttest.TearDown();

            t_discussion = EndPoint.GetDiscussionById(_user.ticket, discussion_id);
            Assert.IsNull(t_discussion, "Discussion has not been deleted with object.");
        }