Add private chat support and group model enhancements

Introduces repositories, validators, and integration tests for private chats. Refactors group-related models to support invitations and memberships, updates group repository interfaces and implementations, and enhances message service logic to handle private chat creation and retrieval. Also registers new services and validators in DI, and updates related tests.
This commit is contained in:
Artemy
2025-07-07 13:55:29 +07:00
parent 66819a015a
commit 2cb6a93060
21 changed files with 454 additions and 54 deletions
@@ -0,0 +1,7 @@
namespace Govor.API.Tests.IntegrationTests.EF.Repositories;
[TestFixture]
public class PrivateChatsRepositoryTests
{
}
@@ -0,0 +1,35 @@
using AutoFixture;
using Govor.API.Hubs;
using Govor.Application.Interfaces.Messages;
using Microsoft.Extensions.Logging;
using Moq;
namespace Govor.API.Tests.IntegrationTests.Hubs;
[TestFixture]
public class ChatsHubTests
{
private Mock<ILogger<ChatsHub>> _loggerMock;
private Mock<IMessageService> _messageServiceMock;
private Fixture _fixture;
private ChatsHub _chatsHub;
[SetUp]
public void SetUp()
{
_fixture = new Fixture();
_fixture.Behaviors.OfType<ThrowingRecursionBehavior>().ToList().ForEach(b => _fixture.Behaviors.Remove(b));
_fixture.Behaviors.Add(new OmitOnRecursionBehavior());
_messageServiceMock = new Mock<IMessageService>();
_loggerMock = new Mock<ILogger<ChatsHub>>();
_chatsHub = new ChatsHub(
_loggerMock.Object,
_messageServiceMock.Object
);
}
// Test for Send action
}