-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathChangePasswordTestShouldThrowInvalidCredentials.cs
More file actions
31 lines (26 loc) · 1.2 KB
/
ChangePasswordTestShouldThrowInvalidCredentials.cs
File metadata and controls
31 lines (26 loc) · 1.2 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
using System.Threading;
using System.Threading.Tasks;
using MangoAPI.BusinessLogic.ApiCommands.Users;
using MangoAPI.BusinessLogic.Responses;
using MangoAPI.Domain.Constants;
using MangoAPI.IntegrationTests.Helpers;
using Xunit;
namespace MangoAPI.IntegrationTests.ApiCommandsTests.ChangePasswordCommandHandlerTests;
public class ChangePasswordTestShouldThrowInvalidCredentials : IntegrationTestBase
{
private readonly Assert<ResponseBase> assert = new();
[Fact]
public async Task ChangePasswordTestShouldThrowInvalidCredentialsAsync()
{
const string expectedMessage = ResponseMessageCodes.InvalidCredentials;
var expectedDetails = ResponseMessageCodes.ErrorDictionary[expectedMessage];
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 RequestAsync(command, CancellationToken.None);
assert.Fail(result, expectedMessage, expectedDetails);
}
}