예제 #1
0
        public void GroupsDiscussRepliesAddTest()
        {
            var topicId    = "72157630982877126";
            var message    = "Test message reply\r\n" + DateTime.Now.ToString("o");
            var newMessage = "New Message reply\r\n" + DateTime.Now.ToString("o");

            AuthInstance.GroupsDiscussRepliesAdd(topicId, message);

            var topicReplies = AuthInstance.GroupsDiscussRepliesGetList(topicId, 1, 100);

            var reply = topicReplies.FirstOrDefault(r => r.Message == message);

            Assert.IsNotNull(reply, "Cannot find matching message.");

            AuthInstance.GroupsDiscussRepliesEdit(topicId, reply.ReplyId, newMessage);

            var reply2 = AuthInstance.GroupsDiscussRepliesGetInfo(topicId, reply.ReplyId);

            Assert.AreEqual(newMessage, reply2.Message, "Message should have been updated.");

            AuthInstance.GroupsDiscussRepliesDelete(topicId, reply.ReplyId);

            topicReplies = AuthInstance.GroupsDiscussRepliesGetList(topicId, 1, 100);

            var reply3 = topicReplies.FirstOrDefault(r => r.ReplyId == reply.ReplyId);

            Assert.IsNull(reply3, "Reply should not exist anymore.");
        }