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