-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathConfirmKeyExchangeSuccess.cs
More file actions
34 lines (29 loc) · 1.35 KB
/
ConfirmKeyExchangeSuccess.cs
File metadata and controls
34 lines (29 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.DiffieHellmanKeyExchanges;
using MangoAPI.BusinessLogic.Responses;
using MangoAPI.IntegrationTests.Helpers;
using Xunit;
namespace MangoAPI.IntegrationTests.ApiCommandsTests.ConfirmKeyExchangeCommandHandlerTests;
public class ConfirmKeyExchangeSuccess : IntegrationTestBase
{
private readonly Assert<ResponseBase> assert = new();
[Fact]
public async Task ConfirmKeyExchangeSuccessAsync()
{
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,
MangoFilesHelper.GetTestImage()),
cancellationToken: CancellationToken.None);
var command = new ConfirmKeyExchangeCommand(
RequestId: keyExchange.Response.RequestId,
UserId: receiver.Response.Tokens.UserId,
ReceiverPublicKey: MangoFilesHelper.GetTestImage());
var response = await RequestAsync(command, CancellationToken.None);
assert.Pass(response);
}
}