using Diligent.WebAPI.Contracts.DTOs.Comment; namespace Diligent.WebAPI.Tests.Controllers { public class CommentsControllerTests { private readonly ICommentService _commentService = Substitute.For(); [Fact] public async Task Addcomment_ShouldReturn_201Created_Always() { _commentService.When(x => x.CreateComment(Arg.Any())).Do(x => { }); CommentsController commentsController = new(_commentService); CommentCreateDto commentCreateDto = new() { ApplicantId = 1000, Content = "some text", UserId = 1000, }; var result = await commentsController.AddComment(commentCreateDto); (result as StatusCodeResult).StatusCode.Should().Be(201); } } }