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(); }
public void AddComment(CommentDto model) => _commentAppService.AddComment(model, UserName);
public void Post([FromBody] CommentDTO comment) { _commentAppService.AddComment(comment, UserId); }
public void Post([FromBody] CommentDTO model) { _commentAppService.AddComment(model, UserId); }