Контракты

This commit is contained in:
Халимов Рустам
2026-03-29 23:39:17 +03:00
parent 22bc964f27
commit 0209802e9e
141 changed files with 1292 additions and 725 deletions
@@ -1,7 +1,7 @@
using FluentAssertions;
using Knot.Modules.Admin.Application.Admin.Commands;
using Knot.Modules.Auth.Application.Abstractions;
using Knot.Modules.Auth.Domain;
using Knot.Modules.Auth.Contracts.Application.Abstractions;
using Knot.Modules.Auth.Contracts.Domain;
using Knot.Shared.Kernel;
using NSubstitute;
using Xunit;
@@ -1,8 +1,8 @@
using FluentAssertions;
using NSubstitute;
using Knot.Modules.Auth.Application.Abstractions;
using Knot.Modules.Auth.Contracts.Application.Abstractions;
using Knot.Modules.Auth.Application.Users.Login;
using Knot.Modules.Auth.Domain;
using Knot.Modules.Auth.Contracts.Domain;
using Knot.Shared.Kernel;
using Knot.Modules.Auth.Application.Users.Auth;
using Xunit;
@@ -12,8 +12,8 @@ using Knot.Modules.Conversations.Domain;
using Knot.Modules.Messaging.Domain;
using Knot.Modules.Conversations.Application.Abstractions;
using Knot.Modules.Conversations.Application.Messages.Send;
using Knot.Modules.Settings.Application.Settings.Abstractions;
using Knot.Modules.Settings.Application.Settings.DTOs;
using Knot.Modules.Settings.Contracts.Application.Abstractions;
using Knot.Modules.Settings.Contracts.Application.DTOs;
namespace Knot.Modules.Conversations.UnitTests.Messages;
@@ -34,7 +34,7 @@ public class SendMessageCommandHandlerTests
_mediator = Substitute.For<IMediator>();
_messagesSettings = Substitute.For<IMessagesSettings>();
var config = new Knot.Modules.Settings.Application.Settings.DTOs.MessagesConfig();
var config = new Knot.Modules.Settings.Contracts.Application.DTOs.MessagesConfig();
_messagesSettings.Current.Returns(config);
_handler = new SendMessageCommandHandler(_chatRepository, _messageRepository, _unitOfWork, _mediator, _messagesSettings);
@@ -2,8 +2,8 @@ using FluentAssertions;
using Knot.Modules.Stories.Application.Stories.Commands.CreateStory;
using Knot.Modules.Stories.Domain;
using Knot.Shared.Kernel;
using Knot.Modules.Settings.Application.Settings.Abstractions;
using Knot.Modules.Settings.Application.Settings.DTOs;
using Knot.Modules.Settings.Contracts.Application.Abstractions;
using Knot.Modules.Settings.Contracts.Application.DTOs;
using Knot.Modules.Stories.Application.Abstractions;
using NSubstitute;
using Xunit;
@@ -1,13 +1,13 @@
using FluentAssertions;
using Knot.Modules.Profiles.Application.Profiles.UpdateProfile;
using Knot.Modules.Profiles.Domain;
using Knot.Modules.Profiles.Contracts.Domain;
using Knot.Modules.Profiles.Contracts.Application.DTOs;
using Knot.Shared.Kernel;
using NSubstitute;
using Xunit;
using System;
using System.Threading;
using System.Threading.Tasks;
using Knot.Modules.Profiles.Application.Abstractions;
namespace Knot.Modules.Profiles.UnitTests;
@@ -27,7 +27,7 @@ public class UpdateProfileCommandHandlerTests
{
// Arrange
var command = new UpdateProfileCommand(Guid.NewGuid(), "FirstName", "Bio", null);
_profileRepository.GetByIdAsync(command.UserId, Arg.Any<CancellationToken>()).Returns((ProfileDocument?)null);
_profileRepository.GetAsync(command.UserId, Arg.Any<CancellationToken>()).Returns((UserProfileDto?)null);
// Act
var result = await _handler.Handle(command, CancellationToken.None);