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:
2026-04-18 10:12:32 -03:00
parent a9838427a4
commit 9bc191c3ae
35 changed files with 79 additions and 75 deletions

View File

@@ -22,7 +22,7 @@ public class CreateTipoDeIvaCommandHandlerTests
public CreateTipoDeIvaCommandHandlerTests()
{
_handler = new CreateTipoDeIvaCommandHandler(_repo, _audit);
_handler = new CreateTipoDeIvaCommandHandler(_repo, _audit, TimeProvider.System);
_repo.InsertAsync(Arg.Any<TipoDeIva>(), Arg.Any<CancellationToken>()).Returns(42);
}

View File

@@ -20,7 +20,7 @@ public class DeactivateTipoDeIvaCommandHandlerTests
public DeactivateTipoDeIvaCommandHandlerTests()
{
_handler = new DeactivateTipoDeIvaCommandHandler(_repo, _audit);
_handler = new DeactivateTipoDeIvaCommandHandler(_repo, _audit, TimeProvider.System);
_repo.GetByIdAsync(1, Arg.Any<CancellationToken>()).Returns(MakeEntity());
_repo.SetActivoAsync(Arg.Any<int>(), Arg.Any<bool>(), Arg.Any<CancellationToken>()).Returns(true);
}

View File

@@ -34,7 +34,7 @@ public class NuevaVersionTipoDeIvaCommandHandlerTests
public NuevaVersionTipoDeIvaCommandHandlerTests()
{
_handler = new NuevaVersionTipoDeIvaCommandHandler(_repo, _audit);
_handler = new NuevaVersionTipoDeIvaCommandHandler(_repo, _audit, TimeProvider.System);
_repo.GetByIdAsync(1, Arg.Any<CancellationToken>()).Returns(MakePredecesora());
_repo.UpdateCierreVigenciaAsync(Arg.Any<int>(), Arg.Any<DateOnly>(), Arg.Any<CancellationToken>())
.Returns(true);

View File

@@ -20,7 +20,7 @@ public class ReactivateTipoDeIvaCommandHandlerTests
public ReactivateTipoDeIvaCommandHandlerTests()
{
_handler = new ReactivateTipoDeIvaCommandHandler(_repo, _audit);
_handler = new ReactivateTipoDeIvaCommandHandler(_repo, _audit, TimeProvider.System);
_repo.GetByIdAsync(1, Arg.Any<CancellationToken>()).Returns(MakeEntity());
_repo.SetActivoAsync(Arg.Any<int>(), Arg.Any<bool>(), Arg.Any<CancellationToken>()).Returns(true);
}

View File

@@ -35,7 +35,7 @@ public class UpdateTipoDeIvaCommandHandlerTests
public UpdateTipoDeIvaCommandHandlerTests()
{
_handler = new UpdateTipoDeIvaCommandHandler(_repo, _audit);
_handler = new UpdateTipoDeIvaCommandHandler(_repo, _audit, TimeProvider.System);
_repo.GetByIdAsync(1, Arg.Any<CancellationToken>()).Returns(MakeEntity());
_repo.UpdateCosmeticoAsync(Arg.Any<int>(), Arg.Any<string>(), Arg.Any<string>(),
Arg.Any<bool>(), Arg.Any<bool>(), Arg.Any<CancellationToken>())