mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
2cb6a93060
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.
35 lines
933 B
C#
35 lines
933 B
C#
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
|
|
|
|
} |