コード例 #1
0
        private string CreateJsonType_2()
        {
            Comment_Type_2 comment2 = CreateCommentType_2();

            string json = JsonConvert.SerializeObject(comment2);

            return(json);
        }
コード例 #2
0
        private Comment_Type_2[] CreateRepliesJson()
        {
            int numberOfAuthors = CreateRandomValue(0, 20);

            Comment_Type_2[] replies = new Comment_Type_2[numberOfAuthors];

            for (int i = 0; i < numberOfAuthors; i++)
            {
                replies[i] = CreateCommentType_2();
            }

            return(replies);
        }
コード例 #3
0
        private Comment_Type_2 CreateCommentType_2()
        {
            Comment_Type_2 comment2 = new Comment_Type_2();

            comment2._id           = CreateRandomValue(0, 999999999).ToString();
            comment2.discussion_id = CreateRandomValue(0, 999999999).ToString();
            comment2.slug          = CreateRandomSlug();
            comment2.posted        = CreateRandomDate().ToString();
            comment2.author        = CreateAuthorsJson();
            comment2.text          = CreateRandomValueFromList(Constants.texts);
            comment2.replies       = CreateRepliesJson();

            return(comment2);
        }