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