| 1234567891011121314151617181920212223242526 |
- using Diligent.WebAPI.Contracts.DTOs.Comment;
-
- namespace Diligent.WebAPI.Tests.Controllers
- {
- public class CommentsControllerTests
- {
- private readonly ICommentService _commentService = Substitute.For<ICommentService>();
-
- [Fact]
- public async Task Addcomment_ShouldReturn_201Created_Always()
- {
- _commentService.When(x => x.CreateComment(Arg.Any<CommentCreateDto>())).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);
- }
- }
- }
|