mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:21:10 +00:00
Removes FluentAssertions library from test projects, due to licensing changes
This commit is contained in:
1 parent
c1100e5398
commit
d46bfae4fc
235 files changed
+4468
-4725
No files matched your search
+10
-11
@@ -1,6 +1,5 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Users;
|
||||
using Lumina.Application.Common.DataAccess.UoW;
|
||||
@@ -76,8 +75,8 @@ public class ChangePasswordCommandHandlerTests
|
||||
ErrorOr<ChangePasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.IsPasswordChanged.Should().BeTrue();
|
||||
Assert.False(result.IsError);
|
||||
Assert.True(result.Value.IsPasswordChanged);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>());
|
||||
_mockHashService.Received(1).CheckStringAgainstHash(currentPassword, "hashedCurrentPassword");
|
||||
@@ -99,8 +98,8 @@ public class ChangePasswordCommandHandlerTests
|
||||
ErrorOr<ChangePasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.UsernameDoesNotExist);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.UsernameDoesNotExist, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(command.Username!, Arg.Any<CancellationToken>());
|
||||
await _mockUserRepository.DidNotReceive().UpdateAsync(Arg.Any<UserEntity>(), Arg.Any<CancellationToken>());
|
||||
@@ -129,8 +128,8 @@ public class ChangePasswordCommandHandlerTests
|
||||
ErrorOr<ChangePasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.InvalidCurrentPassword);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.InvalidCurrentPassword, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>());
|
||||
_mockHashService.Received(1).CheckStringAgainstHash(incorrectPassword, Uri.UnescapeDataString(user.Password));
|
||||
@@ -167,8 +166,8 @@ public class ChangePasswordCommandHandlerTests
|
||||
ErrorOr<ChangePasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>());
|
||||
_mockHashService.Received(1).CheckStringAgainstHash(currentPassword, "hashedCurrentPassword");
|
||||
@@ -197,8 +196,8 @@ public class ChangePasswordCommandHandlerTests
|
||||
ErrorOr<ChangePasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(command.Username!, Arg.Any<CancellationToken>());
|
||||
await _mockUserRepository.DidNotReceive().InsertAsync(Arg.Any<UserEntity>(), Arg.Any<CancellationToken>());
|
||||
|
||||
+16
-17
@@ -1,6 +1,5 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Users;
|
||||
using Lumina.Application.Common.DataAccess.UoW;
|
||||
@@ -82,8 +81,8 @@ public class RecoverPasswordCommandHandlerTests
|
||||
ErrorOr<RecoverPasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.IsPasswordReset.Should().BeTrue();
|
||||
Assert.False(result.IsError);
|
||||
Assert.True(result.Value.IsPasswordReset);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>());
|
||||
_mockTotpTokenGenerator.Received(1).ValidateToken(Arg.Any<byte[]>(), totpCode);
|
||||
@@ -105,8 +104,8 @@ public class RecoverPasswordCommandHandlerTests
|
||||
ErrorOr<RecoverPasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.UsernameDoesNotExist);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.UsernameDoesNotExist, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(command.Username!, Arg.Any<CancellationToken>());
|
||||
await _mockUserRepository.DidNotReceive().UpdateAsync(Arg.Any<UserEntity>(), Arg.Any<CancellationToken>());
|
||||
@@ -130,8 +129,8 @@ public class RecoverPasswordCommandHandlerTests
|
||||
ErrorOr<RecoverPasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.PasswordResetAlreadyRequested);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.PasswordResetAlreadyRequested, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>());
|
||||
await _mockUserRepository.DidNotReceive().UpdateAsync(Arg.Any<UserEntity>(), Arg.Any<CancellationToken>());
|
||||
@@ -154,8 +153,8 @@ public class RecoverPasswordCommandHandlerTests
|
||||
ErrorOr<RecoverPasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.InvalidTotpCode);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.InvalidTotpCode, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>());
|
||||
await _mockUserRepository.DidNotReceive().UpdateAsync(Arg.Any<UserEntity>(), Arg.Any<CancellationToken>());
|
||||
@@ -186,8 +185,8 @@ public class RecoverPasswordCommandHandlerTests
|
||||
ErrorOr<RecoverPasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.InvalidTotpCode);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.InvalidTotpCode, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>());
|
||||
_mockTotpTokenGenerator.Received(1).ValidateToken(Arg.Any<byte[]>(), totpCode);
|
||||
@@ -222,8 +221,8 @@ public class RecoverPasswordCommandHandlerTests
|
||||
ErrorOr<RecoverPasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>());
|
||||
_mockTotpTokenGenerator.Received(1).ValidateToken(Arg.Any<byte[]>(), totpCode);
|
||||
@@ -251,8 +250,8 @@ public class RecoverPasswordCommandHandlerTests
|
||||
ErrorOr<RecoverPasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(command.Username!, Arg.Any<CancellationToken>());
|
||||
await _mockUserRepository.DidNotReceive().InsertAsync(Arg.Any<UserEntity>(), Arg.Any<CancellationToken>());
|
||||
@@ -277,8 +276,8 @@ public class RecoverPasswordCommandHandlerTests
|
||||
ErrorOr<RecoverPasswordResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.InvalidTotpCode);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.InvalidTotpCode, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>());
|
||||
_mockTotpTokenGenerator.DidNotReceive().ValidateToken(Arg.Any<byte[]>(), Arg.Any<string>());
|
||||
|
||||
+12
-13
@@ -1,6 +1,5 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Users;
|
||||
using Lumina.Application.Common.DataAccess.UoW;
|
||||
@@ -88,9 +87,9 @@ public class RegisterUserCommandHandlerTests
|
||||
ErrorOr<RegistrationResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Username.Should().Be(command.Username);
|
||||
result.Value.TotpSecret.Should().Be(qrCodeUri);
|
||||
Assert.False(result.IsError);
|
||||
Assert.Equal(command.Username, result.Value.Username);
|
||||
Assert.Equal(qrCodeUri, result.Value.TotpSecret);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(command.Username!, Arg.Any<CancellationToken>());
|
||||
_mockHashService.Received(1).HashString(command.Password!);
|
||||
@@ -119,9 +118,9 @@ public class RegisterUserCommandHandlerTests
|
||||
ErrorOr<RegistrationResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Username.Should().Be(command.Username);
|
||||
result.Value.TotpSecret.Should().BeNull();
|
||||
Assert.False(result.IsError);
|
||||
Assert.Equal(command.Username, result.Value.Username);
|
||||
Assert.Null(result.Value.TotpSecret);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(command.Username!, Arg.Any<CancellationToken>());
|
||||
_mockHashService.Received(1).HashString(command.Password!);
|
||||
@@ -146,8 +145,8 @@ public class RegisterUserCommandHandlerTests
|
||||
ErrorOr<RegistrationResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.UsernameAlreadyExists);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.UsernameAlreadyExists, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(command.Username!, Arg.Any<CancellationToken>());
|
||||
await _mockUserRepository.DidNotReceive().InsertAsync(Arg.Any<UserEntity>(), Arg.Any<CancellationToken>());
|
||||
@@ -170,8 +169,8 @@ public class RegisterUserCommandHandlerTests
|
||||
ErrorOr<RegistrationResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(command.Username!, Arg.Any<CancellationToken>());
|
||||
await _mockUserRepository.Received(1).InsertAsync(Arg.Any<UserEntity>(), Arg.Any<CancellationToken>());
|
||||
@@ -192,8 +191,8 @@ public class RegisterUserCommandHandlerTests
|
||||
ErrorOr<RegistrationResponse> result = await _sut.Handle(command, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).GetByUsernameAsync(command.Username!, Arg.Any<CancellationToken>());
|
||||
await _mockUserRepository.DidNotReceive().InsertAsync(Arg.Any<UserEntity>(), Arg.Any<CancellationToken>());
|
||||
|
||||
+7
-7
@@ -1,6 +1,5 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Users;
|
||||
using Lumina.Application.Common.DataAccess.UoW;
|
||||
@@ -15,6 +14,7 @@ using NSubstitute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
#endregion
|
||||
@@ -68,8 +68,8 @@ public class GetUsersQueryHandlerTests
|
||||
ErrorOr<IEnumerable<UserResponse>> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authorization.NotAuthorized);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authorization.NotAuthorized, result.FirstError);
|
||||
await _mockUserRepository.DidNotReceive().GetAllAsync(Arg.Any<CancellationToken>());
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@ public class GetUsersQueryHandlerTests
|
||||
ErrorOr<IEnumerable<UserResponse>> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -110,7 +110,7 @@ public class GetUsersQueryHandlerTests
|
||||
ErrorOr<IEnumerable<UserResponse>> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Should().HaveCount(2);
|
||||
Assert.False(result.IsError);
|
||||
Assert.Equal(2, result.Value.Count());
|
||||
}
|
||||
}
|
||||
+29
-30
@@ -1,6 +1,5 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using ErrorOr;
|
||||
using FluentAssertions;
|
||||
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
|
||||
using Lumina.Application.Common.DataAccess.Repositories.Users;
|
||||
using Lumina.Application.Common.DataAccess.UoW;
|
||||
@@ -85,11 +84,11 @@ public class LoginUserQueryHandlerTests
|
||||
ErrorOr<LoginResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Id.Should().Be(user.Id);
|
||||
result.Value.Username.Should().Be(user.Username);
|
||||
result.Value.Token.Should().Be(jwtToken);
|
||||
result.Value.UsesTotp.Should().BeFalse();
|
||||
Assert.False(result.IsError);
|
||||
Assert.Equal(user.Id, result.Value.Id);
|
||||
Assert.Equal(user.Username, result.Value.Username);
|
||||
Assert.Equal(jwtToken, result.Value.Token);
|
||||
Assert.False(result.Value.UsesTotp);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -124,11 +123,11 @@ public class LoginUserQueryHandlerTests
|
||||
ErrorOr<LoginResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Id.Should().Be(user.Id);
|
||||
result.Value.Username.Should().Be(user.Username);
|
||||
result.Value.Token.Should().Be(jwtToken);
|
||||
result.Value.UsesTotp.Should().BeTrue();
|
||||
Assert.False(result.IsError);
|
||||
Assert.Equal(user.Id, result.Value.Id);
|
||||
Assert.Equal(user.Username, result.Value.Username);
|
||||
Assert.Equal(jwtToken, result.Value.Token);
|
||||
Assert.True(result.Value.UsesTotp);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -144,8 +143,8 @@ public class LoginUserQueryHandlerTests
|
||||
ErrorOr<LoginResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.InvalidUsernameOrPassword);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.InvalidUsernameOrPassword, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -170,8 +169,8 @@ public class LoginUserQueryHandlerTests
|
||||
ErrorOr<LoginResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.InvalidUsernameOrPassword);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.InvalidUsernameOrPassword, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -200,8 +199,8 @@ public class LoginUserQueryHandlerTests
|
||||
ErrorOr<LoginResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.TempPasswordExpired);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.TempPasswordExpired, result.FirstError);
|
||||
|
||||
await _mockUserRepository.Received(1).UpdateAsync(Arg.Is<UserEntity>(u =>
|
||||
u.TempPassword == null && u.TempPasswordCreated == null),
|
||||
@@ -240,11 +239,11 @@ public class LoginUserQueryHandlerTests
|
||||
ErrorOr<LoginResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeFalse();
|
||||
result.Value.Id.Should().Be(user.Id);
|
||||
result.Value.Username.Should().Be(user.Username);
|
||||
result.Value.Token.Should().Be(jwtToken);
|
||||
result.Value.UsesTotp.Should().BeFalse();
|
||||
Assert.False(result.IsError);
|
||||
Assert.Equal(user.Id, result.Value.Id);
|
||||
Assert.Equal(user.Username, result.Value.Username);
|
||||
Assert.Equal(jwtToken, result.Value.Token);
|
||||
Assert.False(result.Value.UsesTotp);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -270,8 +269,8 @@ public class LoginUserQueryHandlerTests
|
||||
ErrorOr<LoginResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.InvalidTotpCode);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.InvalidTotpCode, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -303,8 +302,8 @@ public class LoginUserQueryHandlerTests
|
||||
ErrorOr<LoginResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.InvalidTotpCode);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.InvalidTotpCode, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -321,8 +320,8 @@ public class LoginUserQueryHandlerTests
|
||||
ErrorOr<LoginResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(error);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(error, result.FirstError);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -351,8 +350,8 @@ public class LoginUserQueryHandlerTests
|
||||
ErrorOr<LoginResponse> result = await _sut.Handle(query, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
result.IsError.Should().BeTrue();
|
||||
result.FirstError.Should().Be(Errors.Authentication.InvalidUsernameOrPassword);
|
||||
Assert.True(result.IsError);
|
||||
Assert.Equal(Errors.Authentication.InvalidUsernameOrPassword, result.FirstError);
|
||||
|
||||
_mockHashService.Received(1).CheckStringAgainstHash(password, hashedPassword);
|
||||
_mockHashService.Received(1).CheckStringAgainstHash(password, hashedTempPassword);
|
||||
|
||||
Reference in new issue
Block a user