Пример #1
0
        public void GetDiscussionThreadPostTest()
        {
            DiscussionPostTest post = new DiscussionPostTest();

            post.SetUp();
            int post_id = post.Create(GetAdminTicket());

            WebDiscussionService.TransitDiscussionPost t_post = EndPoint.GetDiscussionPostById(GetAdminTicket(), post_id);
            Console.WriteLine("Thread Id: {0}", t_post.DiscussionThreadId);
            WebDiscussionService.TransitDiscussionPost t_threadpost = EndPoint.GetDiscussionThreadPost(GetAdminTicket(), t_post.DiscussionThreadId);
            Assert.AreEqual(t_post.Id, t_threadpost.Id);
            post.Delete(GetAdminTicket(), post_id);
            post.TearDown();
        }
Пример #2
0
        public void GetDiscussionThreadsByDiscussionIdTest()
        {
            DiscussionPostTest post = new DiscussionPostTest();

            post.SetUp();
            int post_id = post.Create(GetAdminTicket());
            int count   = EndPoint.GetDiscussionThreadsCountByDiscussionId(_user.ticket, post._discussion_id);

            Console.WriteLine("Count: {0}", count);
            Assert.AreEqual(count, 1);
            WebDiscussionService.TransitDiscussionPost[] posts = EndPoint.GetDiscussionThreadsByDiscussionId(_user.ticket, post._discussion_id, null);
            Console.WriteLine("Length: {0}", posts.Length);
            Assert.AreEqual(count, posts.Length);
            Assert.IsTrue(new TransitServiceCollection <WebDiscussionService.TransitDiscussionPost>(posts).ContainsId(post_id));
            post.Delete(GetAdminTicket(), post_id);
            post.TearDown();
        }
Пример #3
0
        public void MoveDiscussionThreadTest()
        {
            DiscussionTest discussion    = new DiscussionTest();
            int            discussion_id = discussion.Create(GetAdminTicket());

            discussion.SetUp();
            DiscussionPostTest post = new DiscussionPostTest();

            post.SetUp();
            int post_id = post.Create(GetAdminTicket());

            WebDiscussionService.TransitDiscussionPost t_post = EndPoint.GetDiscussionPostById(GetAdminTicket(), post_id);
            Console.WriteLine("Thread Id: {0}", t_post.DiscussionThreadId);
            EndPoint.MoveDiscussionThread(GetAdminTicket(), t_post.DiscussionThreadId, discussion_id);
            WebDiscussionService.TransitDiscussionThread t_thread = EndPoint.GetDiscussionThreadById(GetAdminTicket(), t_post.DiscussionThreadId);
            Assert.AreEqual(t_thread.DiscussionId, discussion_id);
            post.Delete(GetAdminTicket(), post_id);
            post.TearDown();
            discussion.Delete(GetAdminTicket(), discussion_id);
            discussion.TearDown();
        }