Esempio n. 1
0
        public IList <Comment> MakeComments(Material material, int commentsCount)
        {
            List <Comment> addedComments = new List <Comment>();

            for (int i = 1; i <= CommentsCount; i++)
            {
                Comment comment = new Comment
                {
                    Id          = dataContainer.NextCommentId(),
                    Text        = "",
                    PublishDate = dataContainer.IterateCommentPublishDate(),
                    MaterialId  = material.Id,
                    AuthorId    = dataContainer.GetRandomUserId()
                };

                dataContainer.IterateCommentPublishDate();

                comment.Text = MakeSeedText("комментарий " + i, 8, 4,
                                            $"Комментарий: {comment.Id}, материал {material.Id}");

                addedComments.Add(comment);
            }

            return(addedComments);
        }
        public IList <Comment> MakeComments(Material material, int commentsCount,
                                            ParagraphsCount commentsParagraphsCount)
        {
            var addedComments = new List <Comment>();

            for (int i = 1; i <= CommentsCount; i++)
            {
                var comment = new Comment
                {
                    Id          = dataContainer.NextCommentId(),
                    Text        = GetRandomText(commentsParagraphsCount.Min, commentsParagraphsCount.Max),
                    PublishDate = dataContainer.IterateCommentPublishDate(),
                    MaterialId  = material.Id,
                    AuthorId    = dataContainer.GetRandomUserId()
                };

                dataContainer.IterateCommentPublishDate();

                addedComments.Add(comment);
            }

            return(addedComments);
        }