public async void AddComment_Test_Should_Success()
        {
            var postId       = this.UsingDbContext <Post>(a => a.Post.FirstOrDefault()).Id;
            var authorId     = this.UsingDbContext <User>(a => a.User.FirstOrDefault()).Id;
            var commentInput = new CommentInput()
            {
                Content  = "新的评论",
                AuthorId = authorId,
                PostId   = postId,
            };
            var output = await _commentAppService.AddComment(commentInput);

            output.ShouldNotBeNull();
            output.AuthorName.ShouldNotBeNull();

            this.Dispose();
        }
예제 #2
0
 public void AddComment(CommentDto model) => _commentAppService.AddComment(model, UserName);
예제 #3
0
 public void Post([FromBody] CommentDTO comment)
 {
     _commentAppService.AddComment(comment, UserId);
 }
예제 #4
0
 public void Post([FromBody] CommentDTO model)
 {
     _commentAppService.AddComment(model, UserId);
 }