mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 13:11:10 +00:00
Standardizes test projects against conventions
This commit is contained in:
1 parent
59e16d645a
commit
ced1f778c4
78 files changed
+283
-201
No files matched your search
+6
-6
@@ -54,7 +54,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldChangePasswordSuccessfully()
|
||||
public async Task ChangePassword_WhenCalledWithValidRequest_ShouldChangePasswordSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest request = new(
|
||||
@@ -79,7 +79,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenPasswordsDoNotMatch_ShouldReturnValidationError()
|
||||
public async Task ChangePassword_WhenPasswordsDoNotMatch_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest request = new(
|
||||
@@ -113,7 +113,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task ChangePassword_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest request = new(
|
||||
@@ -142,7 +142,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCurrentPasswordIsIncorrect_ShouldReturnForbiddenResult()
|
||||
public async Task ChangePassword_WhenCurrentPasswordIsIncorrect_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest request = new(
|
||||
@@ -171,7 +171,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
public async Task ChangePassword_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest? request = null;
|
||||
@@ -203,7 +203,7 @@ public class ChangePasswordEndpointTests : IClassFixture<AuthenticatedLuminaApiF
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task ChangePassword_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
ChangePasswordRequest request = new(
|
||||
|
||||
+3
-3
@@ -53,7 +53,7 @@ public class GetUsersEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnUsers()
|
||||
public async Task GetUsers_WhenCalledWithValidRequest_ShouldReturnUsers()
|
||||
{
|
||||
// Act
|
||||
HttpResponseMessage response = await _client.GetAsync("/api/v1/auth/users");
|
||||
@@ -77,7 +77,7 @@ public class GetUsersEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task GetUsers_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -101,7 +101,7 @@ public class GetUsersEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetUsers_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+10
-6
@@ -66,7 +66,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidCredentials_ShouldLoginSuccessfully()
|
||||
public async Task Login_WhenCalledWithValidCredentials_ShouldLoginSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUser();
|
||||
@@ -93,7 +93,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidCredentialsAndTotp_ShouldLoginSuccessfully()
|
||||
public async Task Login_WhenCalledWithValidCredentialsAndTotp_ShouldLoginSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUserWithTotp();
|
||||
@@ -125,7 +125,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithTempPassword_ShouldLoginSuccessfully()
|
||||
public async Task Login_WhenCalledWithTempPassword_ShouldLoginSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUserWithTempPassword();
|
||||
@@ -151,7 +151,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithExpiredTempPassword_ShouldReturnUnauthorized()
|
||||
public async Task Login_WhenCalledWithExpiredTempPassword_ShouldReturnUnauthorized()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUserWithExpiredTempPassword();
|
||||
@@ -179,7 +179,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidCredentials_ShouldReturnUnauthorized()
|
||||
public async Task Login_WhenCalledWithInvalidCredentials_ShouldReturnUnauthorized()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUser();
|
||||
@@ -207,7 +207,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithInvalidTotpCode_ShouldReturnUnauthorized()
|
||||
public async Task Login_WhenCalledWithInvalidTotpCode_ShouldReturnUnauthorized()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateTestUserWithTotp();
|
||||
@@ -247,6 +247,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = _hashService.HashString("TestPass123!"),
|
||||
Libraries = [],
|
||||
@@ -269,6 +270,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
byte[] totpSecret = _totpTokenGenerator.GenerateSecret();
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = _hashService.HashString("TestPass123!"),
|
||||
TotpSecret = _cryptographyService.Encrypt(Convert.ToBase64String(totpSecret)),
|
||||
@@ -291,6 +293,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = _hashService.HashString("TestPass123!"),
|
||||
TempPassword = Uri.EscapeDataString(_hashService.HashString("TempPass123!")),
|
||||
@@ -314,6 +317,7 @@ public class LoginEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory>,
|
||||
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = _hashService.HashString("TestPass123!"),
|
||||
TempPassword = Uri.EscapeDataString(_hashService.HashString("TempPass123!")),
|
||||
|
||||
+9
-7
@@ -69,7 +69,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldResetPassword()
|
||||
public async Task RecoverPassword_WhenCalledWithValidRequest_ShouldResetPassword()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateUserWithTotp();
|
||||
@@ -113,7 +113,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task RecoverPassword_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
RecoverPasswordRequest request = new(
|
||||
@@ -140,7 +140,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenInvalidTotpCode_ShouldReturnForbiddenResult()
|
||||
public async Task RecoverPassword_WhenInvalidTotpCode_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateUserWithTotp();
|
||||
@@ -173,7 +173,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
public async Task RecoverPassword_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
RecoverPasswordRequest? request = null;
|
||||
@@ -203,7 +203,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotUseTotpAndTriesToRecover_ShouldReturnForbiddenResult()
|
||||
public async Task RecoverPassword_WhenUserDoesNotUseTotpAndTriesToRecover_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
UserEntity user = await CreateUserWithoutTotp();
|
||||
@@ -237,7 +237,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotUseTotpAndTriesToRecoverWithoutCode_ShouldReturnForbiddenResult()
|
||||
public async Task RecoverPassword_WhenUserDoesNotUseTotpAndTriesToRecoverWithoutCode_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
// Setup user without TOTP
|
||||
@@ -246,6 +246,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
LuminaDbContext dbContext = scope.ServiceProvider.GetRequiredService<LuminaDbContext>();
|
||||
UserEntity userWithoutTotp = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = "userwithoutotp2",
|
||||
Password = _hashService.HashString("OldPass123!"),
|
||||
TotpSecret = null, // No TOTP configured
|
||||
@@ -288,7 +289,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task RecoverPassword_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
RecoverPasswordRequest request = new(
|
||||
@@ -314,6 +315,7 @@ public class RecoverPasswordEndpointTests : IClassFixture<AuthenticatedLuminaApi
|
||||
byte[] totpSecret = _totpTokenGenerator.GenerateSecret();
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = _hashService.HashString("OldPass123!"),
|
||||
TotpSecret = _cryptographyService.Encrypt(Convert.ToBase64String(totpSecret)),
|
||||
|
||||
+6
-5
@@ -57,7 +57,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldRegisterUserSuccessfully()
|
||||
public async Task Register_WhenCalledWithValidRequest_ShouldRegisterUserSuccessfully()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest request = new(
|
||||
@@ -85,7 +85,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequestAnd2FA_ShouldRegisterUserWithTotp()
|
||||
public async Task Register_WhenCalledWithValidRequestAnd2FA_ShouldRegisterUserWithTotp()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest request = new(
|
||||
@@ -112,7 +112,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUsernameAlreadyExists_ShouldReturnConflict()
|
||||
public async Task Register_WhenUsernameAlreadyExists_ShouldReturnConflict()
|
||||
{
|
||||
// Arrange
|
||||
await CreateTestUser();
|
||||
@@ -138,7 +138,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenPasswordsDoNotMatch_ShouldReturnValidationError()
|
||||
public async Task Register_WhenPasswordsDoNotMatch_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest request = new(
|
||||
@@ -164,7 +164,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
public async Task Register_WhenRequestIsNull_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
RegistrationRequest? request = null;
|
||||
@@ -193,6 +193,7 @@ public class RegisterEndpointTests : IClassFixture<AuthenticatedLuminaApiFactory
|
||||
|
||||
UserEntity user = new()
|
||||
{
|
||||
Id = Guid.NewGuid(),
|
||||
Username = _testUsername,
|
||||
Password = new PasswordHashService().HashString("TestPass123!"),
|
||||
Libraries = [],
|
||||
|
||||
+4
-4
@@ -65,7 +65,7 @@ public class GetAuthorizationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnAuthorizationDetails()
|
||||
public async Task GetAuthorization_WhenCalledWithValidRequest_ShouldReturnAuthorizationDetails()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -97,7 +97,7 @@ public class GetAuthorizationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnForbiddenResult()
|
||||
public async Task GetAuthorization_WhenUserDoesNotExist_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
GetAuthorizationRequest request = new(Guid.NewGuid());
|
||||
@@ -121,7 +121,7 @@ public class GetAuthorizationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserIdIsEmpty_ShouldReturnValidationError()
|
||||
public async Task GetAuthorization_WhenUserIdIsEmpty_ShouldReturnValidationError()
|
||||
{
|
||||
// Arrange
|
||||
GetAuthorizationRequest request = new(Guid.Empty);
|
||||
@@ -150,7 +150,7 @@ public class GetAuthorizationEndpointTests : IClassFixture<AuthenticatedLuminaAp
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetAuthorization_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
GetAuthorizationRequest request = new(Guid.NewGuid());
|
||||
|
||||
+4
-4
@@ -55,7 +55,7 @@ public class GetUserPermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnUserPermissions()
|
||||
public async Task GetUserPermissions_WhenCalledWithValidRequest_ShouldReturnUserPermissions()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -97,7 +97,7 @@ public class GetUserPermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task GetUserPermissions_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -125,7 +125,7 @@ public class GetUserPermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task GetUserPermissions_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
Guid nonExistentUserId = Guid.NewGuid();
|
||||
@@ -149,7 +149,7 @@ public class GetUserPermissionsEndpointTests : IClassFixture<AuthenticatedLumina
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetUserPermissions_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+4
-4
@@ -54,7 +54,7 @@ public class GetUserRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldReturnUserRole()
|
||||
public async Task GetUserRole_WhenCalledWithValidRequest_ShouldReturnUserRole()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -78,7 +78,7 @@ public class GetUserRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task GetUserRole_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -106,7 +106,7 @@ public class GetUserRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task GetUserRole_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
Guid nonExistentUserId = Guid.NewGuid();
|
||||
@@ -130,7 +130,7 @@ public class GetUserRoleEndpointTests : IClassFixture<AuthenticatedLuminaApiFact
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task GetUserRole_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
+5
-5
@@ -56,7 +56,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithValidRequest_ShouldUpdateUserRoleAndPermissions()
|
||||
public async Task UpdateUserRoleAndPermissions_WhenCalledWithValidRequest_ShouldUpdateUserRoleAndPermissions()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -114,7 +114,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
|
||||
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
public async Task UpdateUserRoleAndPermissions_WhenCalledWithNonAdminAccount_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
_client = await _apiFactory.CreateAuthenticatedClientAsync();
|
||||
@@ -143,7 +143,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenTryingToRemoveLastAdmin_ShouldReturnForbiddenResult()
|
||||
public async Task UpdateUserRoleAndPermissions_WhenTryingToRemoveLastAdmin_ShouldReturnForbiddenResult()
|
||||
{
|
||||
// Arrange
|
||||
using IServiceScope scope = _apiFactory.Services.CreateScope();
|
||||
@@ -188,7 +188,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
public async Task UpdateUserRoleAndPermissions_WhenUserDoesNotExist_ShouldReturnNotFound()
|
||||
{
|
||||
// Arrange
|
||||
Guid nonExistentUserId = Guid.NewGuid();
|
||||
@@ -217,7 +217,7 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<Authentic
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ExecuteAsync_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
public async Task UpdateUserRoleAndPermissions_WhenCancellationRequested_ShouldThrowTaskCanceledException()
|
||||
{
|
||||
// Arrange
|
||||
using CancellationTokenSource cts = new();
|
||||
|
||||
Reference in new issue
Block a user