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