public async Task UpdateFriendshipStatus_ShouldReturnNotFound_WhenFriendshipDoesNotExist()
        {
            // Arrange
            const int friendshipId = 87921;

            UpdateFriendshipStatusBody model = new UpdateFriendshipStatusBody
            {
                FriendshipStatusId = FriendshipStatusId.Accepted
            };

            Mock <IMediator> mediatorMock = new Mock <IMediator>();

            mediatorMock
            .Setup(m => m.Send(It.IsAny <FriendshipExistsQuery>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(false);

            FriendshipController controller = new FriendshipController(mediatorMock.Object, null);

            // Act
            ActionResult response = await controller.UpdateFriendshipStatus(friendshipId, model);

            // Assert
            NotFoundObjectResult result = Assert.IsType <NotFoundObjectResult>(response);

            ErrorResource error = Assert.IsType <ErrorResource>(result.Value);

            Assert.Equal(StatusCodes.Status404NotFound, error.StatusCode);
        }
        public async Task UpdateFriendshipStatus_ShouldReturnNoContentResult()
        {
            // Arrange
            const int friendshipId = 1;

            UpdateFriendshipStatusBody model = new UpdateFriendshipStatusBody
            {
                FriendshipStatusId = FriendshipStatusId.Accepted
            };

            Mock <IMediator> mediatorMock = new Mock <IMediator>();

            mediatorMock
            .Setup(m => m.Send(It.IsAny <FriendshipExistsQuery>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(true);

            mediatorMock
            .Setup(m => m.Send(It.IsAny <UpdateFriendshipStatusCommand>(), It.IsAny <CancellationToken>()))
            .Returns(Unit.Task);

            FriendshipController controller = new FriendshipController(mediatorMock.Object, null);

            // Act
            ActionResult response = await controller.UpdateFriendshipStatus(friendshipId, model);

            // Assert
            Assert.IsType <NoContentResult>(response);
            mediatorMock.Verify(m => m.Send(It.IsAny <UpdateFriendshipStatusCommand>(), It.IsAny <CancellationToken>()), Times.Once);
        }
        public async Task UpdateFriendshipStatus_ShouldReturnBadRequestResult_WhenModelValidationFails()
        {
            // Arrange
            FriendshipController controller = new FriendshipController(null, null);

            controller.ModelState.AddModelError("", "");

            // Act
            ActionResult response = await controller.UpdateFriendshipStatus(0, null);

            // Assert
            Assert.IsType <BadRequestObjectResult>(response);
        }