-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathAddContactShouldThrowUserNotFound.cs
More file actions
30 lines (25 loc) · 1.07 KB
/
AddContactShouldThrowUserNotFound.cs
File metadata and controls
30 lines (25 loc) · 1.07 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
using System;
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Contacts;
using MangoAPI.BusinessLogic.Responses;
using MangoAPI.Domain.Constants;
using MangoAPI.IntegrationTests.Helpers;
using Xunit;
namespace MangoAPI.IntegrationTests.ApiCommandsTests.AddContactCommandHandlerTests;
public class AddContactShouldThrowUserNotFound : IntegrationTestBase
{
private readonly Assert<ResponseBase> assert = new();
[Fact]
public async Task AddContactCommandHandlerTestShouldThrowUserNotFoundAsync()
{
const string expectedMessage = ResponseMessageCodes.UserNotFound;
var expectedDetails = ResponseMessageCodes.ErrorDictionary[expectedMessage];
var user = await RequestAsync(CommandHelper.RegisterPetroCommand(), CancellationToken.None);
var command = new AddContactCommand(
UserId: user.Response.Tokens.UserId,
ContactId: Guid.Empty);
var result = await RequestAsync(command, CancellationToken.None);
assert.Fail(result, expectedMessage, expectedDetails);
}
}