test(udt-011): T400.40 — update tests for TimeProvider injection and explicit now params
Fix all test compilation errors caused by T400.10/T400.20/T400.30: - Handler constructors: add TimeProvider.System as last argument - Domain mutator calls: add DateTime.UtcNow as explicit 'now' argument - AuditLogger/SecurityEventLogger Build() helpers: add TimeProvider.System - JwtService test constructors: add TimeProvider.System Cat2 coverage already present in TimeProviderArgentinaExtensionsTests.cs: FakeTimeProvider proves GetArgentinaToday() returns ART civil date, not UTC.
This commit is contained in:
@@ -17,7 +17,7 @@ public class DeactivateUsuarioCommandHandlerTests
|
||||
|
||||
public DeactivateUsuarioCommandHandlerTests()
|
||||
{
|
||||
_handler = new DeactivateUsuarioCommandHandler(_repo, _refreshRepo, _audit);
|
||||
_handler = new DeactivateUsuarioCommandHandler(_repo, _refreshRepo, _audit, TimeProvider.System);
|
||||
_repo.CountActiveAdminsAsync(Arg.Any<CancellationToken>()).Returns(2);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ReactivateUsuarioCommandHandlerTests
|
||||
|
||||
public ReactivateUsuarioCommandHandlerTests()
|
||||
{
|
||||
_handler = new ReactivateUsuarioCommandHandler(_repo, _audit);
|
||||
_handler = new ReactivateUsuarioCommandHandler(_repo, _audit, TimeProvider.System);
|
||||
}
|
||||
|
||||
private static Usuario MakeUser(int id = 5, bool activo = false)
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ResetUsuarioPasswordCommandHandlerTests
|
||||
|
||||
public ResetUsuarioPasswordCommandHandlerTests()
|
||||
{
|
||||
_handler = new ResetUsuarioPasswordCommandHandler(_repo, _hasher, _refreshRepo, _audit);
|
||||
_handler = new ResetUsuarioPasswordCommandHandler(_repo, _hasher, _refreshRepo, _audit, TimeProvider.System);
|
||||
_hasher.Hash(Arg.Any<string>()).Returns(args => "$2a$12$hashof_" + args[0]);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class UpdateUsuarioCommandHandlerTests
|
||||
|
||||
public UpdateUsuarioCommandHandlerTests()
|
||||
{
|
||||
_handler = new UpdateUsuarioCommandHandler(_repo, _rolRepo, _refreshRepo, _audit);
|
||||
_handler = new UpdateUsuarioCommandHandler(_repo, _rolRepo, _refreshRepo, _audit, TimeProvider.System);
|
||||
|
||||
// Default: rol exists and is active
|
||||
_rolRepo.ExistsActiveByCodigoAsync(Arg.Any<string>(), Arg.Any<CancellationToken>()).Returns(true);
|
||||
|
||||
Reference in New Issue
Block a user