Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete MangoCommandExecutor.cs | delete MangoCompositionRoot.cs | del… #499

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
var user = await dbContext.Users.AsNoTracking()
.Select(x => new
{
x.DisplayName, x.DisplayNameColour, Image = x.ImageFileName, x.Id,

Check warning on line 48 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Quodana Analysis (ubuntu-latest)

Fix formatting

Check warning on line 48 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Quodana Analysis (ubuntu-latest)

Fix formatting

Check warning on line 48 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Quodana Analysis (ubuntu-latest)

Fix formatting

Check warning on line 48 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Resharper Analysis (ubuntu-latest)

Fix formatting

Check warning on line 48 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Resharper Analysis (ubuntu-latest)

Fix formatting

Check warning on line 48 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Resharper Analysis (ubuntu-latest)

Fix formatting

Check warning on line 48 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Resharper Analysis (ubuntu-latest)

"[IDE0055] Fix formatting" on /home/runner/work/MangoMessengerAPI/MangoMessengerAPI/MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs(48,1727)

Check warning on line 48 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Build Test Coverage (ubuntu-latest)

Fix formatting

Check warning on line 48 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Build Test Coverage (ubuntu-latest)

Fix formatting

Check warning on line 48 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Build Test Coverage (ubuntu-latest)

Fix formatting
}).FirstOrDefaultAsync(
x => x.Id == request.UserId, cancellationToken);

Expand All @@ -57,7 +57,7 @@
return responseFactory.ConflictResponse(errorMessage, errorDescription);
}

var userChat = await dbContext.UserChats.AsNoTracking()
var userChat = await dbContext.UserChats
.Select(x => new { x.ChatId, x.RoleId, x.Chat, }).FirstOrDefaultAsync(
x => x.ChatId == request.ChatId,
cancellationToken);
Expand Down Expand Up @@ -105,9 +105,9 @@
user.DisplayNameColour,
messageEntity.Text,
messageEntity.CreatedAt,
messageEntity.UpdatedAt,

Check warning on line 108 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Quodana Analysis (ubuntu-latest)

Fix formatting

Check warning on line 108 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Resharper Analysis (ubuntu-latest)

Fix formatting

Check warning on line 108 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Build Test Coverage (ubuntu-latest)

Fix formatting
messageEntity.InReplyToUser,

Check warning on line 109 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Quodana Analysis (ubuntu-latest)

Fix formatting

Check warning on line 109 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Resharper Analysis (ubuntu-latest)

Fix formatting

Check warning on line 109 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Build Test Coverage (ubuntu-latest)

Fix formatting
messageEntity.InReplyToText,

Check warning on line 110 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Quodana Analysis (ubuntu-latest)

Fix formatting

Check warning on line 110 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Resharper Analysis (ubuntu-latest)

Fix formatting

Check warning on line 110 in MangoAPI.BusinessLogic/ApiCommands/Messages/SendMessageCommandHandler.cs

View workflow job for this annotation

GitHub Actions / Build Test Coverage (ubuntu-latest)

Fix formatting
authorImageUrl,
attachmentUrl);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public async Task<Result<UpdatePersonalInformationResponse>> Handle(
UpdatePersonalInformationCommand request,
CancellationToken cancellationToken)
{
var user = await dbContext.Users.AsNoTracking()
var user = await dbContext.Users
.Include(x => x.PersonalInformation)
.FirstOrDefaultAsync(x => x.Id == request.UserId, cancellationToken);

Expand Down
21 changes: 0 additions & 21 deletions MangoAPI.BusinessLogic/Configuration/MangoCommandExecutor.cs

This file was deleted.

20 changes: 0 additions & 20 deletions MangoAPI.BusinessLogic/Configuration/MangoCompositionRoot.cs

This file was deleted.

18 changes: 0 additions & 18 deletions MangoAPI.BusinessLogic/MangoModule.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Contacts;
using MangoAPI.BusinessLogic.Responses;
Expand All @@ -19,11 +18,10 @@ public async Task AddContactCommandHandlerTestShouldThrowCannotAddSelfAsync()
const string expectedMessage = ResponseMessageCodes.CannotAddSelfToContacts;
var expectedDetails = ResponseMessageCodes.ErrorDictionary[expectedMessage];
var registerPetroCommand = CommandHelper.RegisterPetroCommand();
var user =
await MangoModule.RequestAsync(registerPetroCommand, CancellationToken.None);

var user = await RequestAsync(registerPetroCommand, CancellationToken.None);

var command = new AddContactCommand(user.Response.Tokens.UserId, user.Response.Tokens.UserId);
var result = await MangoModule.RequestAsync(command, CancellationToken.None);
var result = await RequestAsync(command, CancellationToken.None);

assert.Fail(result, expectedMessage, expectedDetails);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Contacts;
using MangoAPI.BusinessLogic.Responses;
Expand All @@ -18,12 +17,12 @@ public async Task AddContactCommandHandlerTestShouldThrowContactExistsAsync()
{
const string expectedMessage = ResponseMessageCodes.ContactAlreadyExist;
var expectedDetails = ResponseMessageCodes.ErrorDictionary[expectedMessage];
var sender = await MangoModule.RequestAsync(CommandHelper.RegisterKhachaturCommand(), CancellationToken.None);
var receiver = await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var sender = await RequestAsync(CommandHelper.RegisterKhachaturCommand(), CancellationToken.None);
var receiver = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var command = new AddContactCommand(sender.Response.Tokens.UserId, receiver.Response.Tokens.UserId);
await MangoModule.RequestAsync(command, CancellationToken.None);
await RequestAsync(command, CancellationToken.None);

var result = await MangoModule.RequestAsync(command, CancellationToken.None);
var result = await RequestAsync(command, CancellationToken.None);

assert.Fail(result, expectedMessage, expectedDetails);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Contacts;
Expand All @@ -19,13 +18,12 @@ public async Task AddContactCommandHandlerTestShouldThrowUserNotFoundAsync()
{
const string expectedMessage = ResponseMessageCodes.UserNotFound;
var expectedDetails = ResponseMessageCodes.ErrorDictionary[expectedMessage];
var user =
await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var user = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var command = new AddContactCommand(
UserId: user.Response.Tokens.UserId,
ContactId: Guid.Empty);

var result = await MangoModule.RequestAsync(command, CancellationToken.None);
var result = await RequestAsync(command, CancellationToken.None);

assert.Fail(result, expectedMessage, expectedDetails);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Contacts;
using MangoAPI.BusinessLogic.Responses;
Expand All @@ -15,13 +14,13 @@ public class AddContactSuccess : IntegrationTestBase
[Fact]
public async Task AddContactsCommandHandlerTestSuccessAsync()
{
var sender = await MangoModule.RequestAsync(CommandHelper.RegisterKhachaturCommand(), CancellationToken.None);
var receiver = await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var sender = await RequestAsync(CommandHelper.RegisterKhachaturCommand(), CancellationToken.None);
var receiver = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var command = new AddContactCommand(
UserId: sender.Response.Tokens.UserId,
ContactId: receiver.Response.Tokens.UserId);

var result = await MangoModule.RequestAsync(command, CancellationToken.None);
var result = await RequestAsync(command, CancellationToken.None);

assert.Pass(result);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Communities;
Expand All @@ -19,11 +18,10 @@ public async Task ArchiveChatTestShouldThrowChatNotFoundAsync()
{
const string expectedMessage = ResponseMessageCodes.ChatNotFound;
var expectedDetails = ResponseMessageCodes.ErrorDictionary[expectedMessage];
var user =
await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var user = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var command = new ArchiveChatCommand(ChatId: Guid.NewGuid(), UserId: user.Response.Tokens.UserId);

var result = await MangoModule.RequestAsync(command, CancellationToken.None);
var result = await RequestAsync(command, CancellationToken.None);

assert.Fail(result, expectedMessage, expectedDetails);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Communities;
using MangoAPI.BusinessLogic.Responses;
Expand All @@ -15,15 +14,13 @@ public class ArchiveChatTestSuccess : IntegrationTestBase
[Fact]
public async Task ArchiveChatTestSuccessAsync()
{
var user =
await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var chat =
await MangoModule.RequestAsync(
var user = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var chat = await RequestAsync(
CommandHelper.CreateExtremeCodeMainChatCommand(user.Response.Tokens.UserId),
CancellationToken.None);
var command = new ArchiveChatCommand(ChatId: chat.Response.ChatId, UserId: user.Response.Tokens.UserId);

var result = await MangoModule.RequestAsync(command, CancellationToken.None);
var result = await RequestAsync(command, CancellationToken.None);

assert.Pass(result);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Users;
using MangoAPI.BusinessLogic.Responses;
Expand All @@ -18,15 +17,14 @@ public async Task ChangePasswordTestShouldThrowInvalidCredentialsAsync()
{
const string expectedMessage = ResponseMessageCodes.InvalidCredentials;
var expectedDetails = ResponseMessageCodes.ErrorDictionary[expectedMessage];
var user =
await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var user = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var command = new ChangePasswordCommand(
UserId: user.Response.Tokens.UserId,
CurrentPassword: "Gm3-`xPRr-/q#6)rgf^925",
NewPassword: "Gm3-`xPRr-/q#6)re^94",
RepeatNewPassword: "Gm3-`xPRr-/q#6)re^94");

var result = await MangoModule.RequestAsync(command, CancellationToken.None);
var result = await RequestAsync(command, CancellationToken.None);

assert.Fail(result, expectedMessage, expectedDetails);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Users;
Expand All @@ -24,7 +23,7 @@ public async Task ChangePasswordTestShouldThrowUserNotFoundAsync()
NewPassword: "Gm3-`xPRr-/q#6)re^94",
RepeatNewPassword: "Gm3-`xPRr-/q#6)re^94");

var result = await MangoModule.RequestAsync(command, CancellationToken.None);
var result = await RequestAsync(command, CancellationToken.None);

assert.Fail(result, expectedMessage, expectedDetails);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Users;
using MangoAPI.BusinessLogic.Responses;
Expand All @@ -15,15 +14,14 @@ public class ChangePasswordTestSuccess : IntegrationTestBase
[Fact]
public async Task ChangePasswordTestSuccessAsync()
{
var user =
await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var user = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var command = new ChangePasswordCommand(
UserId: user.Response.Tokens.UserId,
CurrentPassword: "Bm3-`dPRv-/w#3)cw^97",
NewPassword: "Gm3-`xPRr-/q#6)re^94",
RepeatNewPassword: "Gm3-`xPRr-/q#6)re^94");

var result = await MangoModule.RequestAsync(command, CancellationToken.None);
var result = await RequestAsync(command, CancellationToken.None);

assert.Pass(result);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.DiffieHellmanKeyExchanges;
Expand All @@ -19,14 +18,13 @@ public async Task ConfirmKeyExchangeShouldThrowKeyExchangeRequestNotFoundAsync()
{
const string expectedMessage = ResponseMessageCodes.KeyExchangeRequestNotFound;
var expectedDetails = ResponseMessageCodes.ErrorDictionary[expectedMessage];
var requestedUser =
await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var requestedUser = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var command = new ConfirmKeyExchangeCommand(
RequestId: Guid.NewGuid(),
UserId: requestedUser.Response.Tokens.UserId,
ReceiverPublicKey: MangoFilesHelper.GetTestImage());

var response = await MangoModule.RequestAsync(command, CancellationToken.None);
var response = await RequestAsync(command, CancellationToken.None);

assert.Fail(response, expectedMessage, expectedDetails);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.DiffieHellmanKeyExchanges;
using MangoAPI.BusinessLogic.Responses;
Expand All @@ -15,11 +14,9 @@ public class ConfirmKeyExchangeSuccess : IntegrationTestBase
[Fact]
public async Task ConfirmKeyExchangeSuccessAsync()
{
var sender =
await MangoModule.RequestAsync(CommandHelper.RegisterKhachaturCommand(), CancellationToken.None);
var receiver =
await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var keyExchange = await MangoModule.RequestAsync(
var sender = await RequestAsync(CommandHelper.RegisterKhachaturCommand(), CancellationToken.None);
var receiver = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var keyExchange = await RequestAsync(
request: CommandHelper.CreateOpenSslCreateKeyExchangeCommand(
receiver.Response.Tokens.UserId,
sender.Response.Tokens.UserId,
Expand All @@ -30,7 +27,7 @@ public async Task ConfirmKeyExchangeSuccessAsync()
UserId: receiver.Response.Tokens.UserId,
ReceiverPublicKey: MangoFilesHelper.GetTestImage());

var response = await MangoModule.RequestAsync(command, CancellationToken.None);
var response = await RequestAsync(command, CancellationToken.None);

assert.Pass(response);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Communities;
using MangoAPI.IntegrationTests.Helpers;
Expand All @@ -14,11 +13,9 @@ public class CreateChannelTestSuccess : IntegrationTestBase
[Fact]
public async Task CreateChannelTestSuccessAsync()
{
var user =
await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var user = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);

var result =
await MangoModule.RequestAsync(
var result = await RequestAsync(
CommandHelper.CreateExtremeCodeMainChatCommand(user.Response.Tokens.UserId),
CancellationToken.None);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using MangoAPI.BusinessLogic;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Communities;
using MangoAPI.Domain.Constants;
Expand All @@ -17,13 +16,12 @@ public async Task CreateChatShouldThrowCannotCreateSelfChatAsync()
{
const string expectedMessage = ResponseMessageCodes.CannotCreateSelfChat;
var expectedDetails = ResponseMessageCodes.ErrorDictionary[expectedMessage];
var user =
await MangoModule.RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var user = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var command = new CreateChatCommand(
UserId: user.Response.Tokens.UserId,
PartnerId: user.Response.Tokens.UserId);

var result = await MangoModule.RequestAsync(command, CancellationToken.None);
var result = await RequestAsync(command, CancellationToken.None);

assert.Fail(result, expectedMessage, expectedDetails);
}
Expand Down
Loading
Loading