diff --git a/tests/SIGCM2.Application.Tests/Auth/Login/LoginCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Auth/Login/LoginCommandHandlerTests.cs index 103300b..ef202a0 100644 --- a/tests/SIGCM2.Application.Tests/Auth/Login/LoginCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Auth/Login/LoginCommandHandlerTests.cs @@ -44,7 +44,7 @@ public class LoginCommandHandlerTests _handler = new LoginCommandHandler( _repository, _hasher, _jwtService, _refreshRepo, _refreshGenerator, _clientCtx, _authOptions, - _rolPermisoRepo, _security, _logger); + _rolPermisoRepo, _security, _logger, TimeProvider.System); } // Scenario: valid credentials → returns token response with usuario populated diff --git a/tests/SIGCM2.Application.Tests/Auth/Logout/LogoutCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Auth/Logout/LogoutCommandHandlerTests.cs index ed07064..dcba3c0 100644 --- a/tests/SIGCM2.Application.Tests/Auth/Logout/LogoutCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Auth/Logout/LogoutCommandHandlerTests.cs @@ -13,7 +13,7 @@ public class LogoutCommandHandlerTests public LogoutCommandHandlerTests() { - _handler = new LogoutCommandHandler(_refreshRepo, _security); + _handler = new LogoutCommandHandler(_refreshRepo, _security, TimeProvider.System); } [Fact] diff --git a/tests/SIGCM2.Application.Tests/Auth/Refresh/RefreshCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Auth/Refresh/RefreshCommandHandlerTests.cs index 7423cf0..5dba28c 100644 --- a/tests/SIGCM2.Application.Tests/Auth/Refresh/RefreshCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Auth/Refresh/RefreshCommandHandlerTests.cs @@ -36,7 +36,8 @@ public class RefreshCommandHandlerTests _generator.Generate().Returns("new_raw_token_value_xyz"); _handler = new RefreshCommandHandler( - _refreshRepo, _usuarioRepo, _jwtService, _generator, _clientCtx, _authOptions, _security); + _refreshRepo, _usuarioRepo, _jwtService, _generator, _clientCtx, _authOptions, _security, + TimeProvider.System); } // Helper: build an active stored RefreshToken with a matching principal diff --git a/tests/SIGCM2.Application.Tests/Domain/Fiscal/IngresosBrutosTests.cs b/tests/SIGCM2.Application.Tests/Domain/Fiscal/IngresosBrutosTests.cs index e3602c8..122529f 100644 --- a/tests/SIGCM2.Application.Tests/Domain/Fiscal/IngresosBrutosTests.cs +++ b/tests/SIGCM2.Application.Tests/Domain/Fiscal/IngresosBrutosTests.cs @@ -95,7 +95,7 @@ public class IngresosBrutosTests { var original = MakeIIBB(descripcion: "Original"); - var updated = original.WithDescripcion("Actualizado"); + var updated = original.WithDescripcion("Actualizado", DateTime.UtcNow); updated.Should().NotBeSameAs(original); updated.Descripcion.Should().Be("Actualizado"); @@ -107,7 +107,7 @@ public class IngresosBrutosTests { var original = MakeIIBB(activo: true); - var deactivated = original.Deactivate(); + var deactivated = original.Deactivate(DateTime.UtcNow); deactivated.Activo.Should().BeFalse(); deactivated.Alicuota.Should().Be(original.Alicuota); @@ -119,7 +119,7 @@ public class IngresosBrutosTests { var original = MakeIIBB(activo: false); - var reactivated = original.Reactivate(); + var reactivated = original.Reactivate(DateTime.UtcNow); reactivated.Activo.Should().BeTrue(); } @@ -130,7 +130,7 @@ public class IngresosBrutosTests var original = MakeIIBB(vigenciaHasta: null); var hasta = new DateOnly(2026, 5, 31); - var cerrado = original.CerrarVigencia(hasta); + var cerrado = original.CerrarVigencia(hasta, DateTime.UtcNow); cerrado.VigenciaHasta.Should().Be(hasta); cerrado.Alicuota.Should().Be(original.Alicuota); @@ -143,7 +143,7 @@ public class IngresosBrutosTests { var predecesora = MakeIIBB(id: 5, alicuota: 2.5m, vigenciaDesde: Desde2020, vigenciaHasta: null); - var (cerrada, nueva) = predecesora.NuevaVersion(3.0m, Desde2026); + var (cerrada, nueva) = predecesora.NuevaVersion(3.0m, Desde2026, DateTime.UtcNow); cerrada.Id.Should().Be(5); cerrada.VigenciaHasta.Should().Be(Desde2026.AddDays(-1)); @@ -166,7 +166,7 @@ public class IngresosBrutosTests vigenciaDesde: Desde2020, vigenciaHasta: new DateOnly(2025, 12, 31)); - var act = () => predecesora.NuevaVersion(4.0m, Desde2026); + var act = () => predecesora.NuevaVersion(4.0m, Desde2026, DateTime.UtcNow); act.Should().Throw(); } @@ -176,7 +176,7 @@ public class IngresosBrutosTests { var predecesora = MakeIIBB(vigenciaDesde: Desde2020, vigenciaHasta: null); - var act = () => predecesora.NuevaVersion(4.0m, Desde2020); + var act = () => predecesora.NuevaVersion(4.0m, Desde2020, DateTime.UtcNow); act.Should().Throw() .WithParameterName("vigenciaDesde"); @@ -187,7 +187,7 @@ public class IngresosBrutosTests { var predecesora = MakeIIBB(vigenciaDesde: Desde2020, vigenciaHasta: null); - var act = () => predecesora.NuevaVersion(-1m, Desde2026); + var act = () => predecesora.NuevaVersion(-1m, Desde2026, DateTime.UtcNow); act.Should().Throw() .WithParameterName("nuevaAlicuota"); @@ -198,7 +198,7 @@ public class IngresosBrutosTests { var predecesora = MakeIIBB(vigenciaDesde: Desde2020, vigenciaHasta: null); - var act = () => predecesora.NuevaVersion(101m, Desde2026); + var act = () => predecesora.NuevaVersion(101m, Desde2026, DateTime.UtcNow); act.Should().Throw() .WithParameterName("nuevaAlicuota"); diff --git a/tests/SIGCM2.Application.Tests/Domain/Fiscal/TipoDeIvaTests.cs b/tests/SIGCM2.Application.Tests/Domain/Fiscal/TipoDeIvaTests.cs index b5d700f..a33d951 100644 --- a/tests/SIGCM2.Application.Tests/Domain/Fiscal/TipoDeIvaTests.cs +++ b/tests/SIGCM2.Application.Tests/Domain/Fiscal/TipoDeIvaTests.cs @@ -150,7 +150,7 @@ public class TipoDeIvaTests { var original = MakeTipoDeIva(descripcion: "Original"); - var updated = original.WithDescripcion("Nueva descripcion"); + var updated = original.WithDescripcion("Nueva descripcion", DateTime.UtcNow); updated.Should().NotBeSameAs(original); updated.Descripcion.Should().Be("Nueva descripcion"); @@ -162,7 +162,7 @@ public class TipoDeIvaTests { var original = MakeTipoDeIva(codigo: "IVA_21"); - var updated = original.WithCodigo("NO_GRAVADO"); + var updated = original.WithCodigo("NO_GRAVADO", DateTime.UtcNow); updated.Codigo.Should().Be("NO_GRAVADO"); updated.Porcentaje.Should().Be(original.Porcentaje); @@ -174,7 +174,7 @@ public class TipoDeIvaTests { var original = MakeTipoDeIva(aplicaIVA: true); - var updated = original.WithAplicaIVA(false); + var updated = original.WithAplicaIVA(false, DateTime.UtcNow); updated.AplicaIVA.Should().BeFalse(); updated.Porcentaje.Should().Be(original.Porcentaje); @@ -185,7 +185,7 @@ public class TipoDeIvaTests { var original = MakeTipoDeIva(activo: true); - var deactivated = original.Deactivate(); + var deactivated = original.Deactivate(DateTime.UtcNow); deactivated.Activo.Should().BeFalse(); deactivated.Porcentaje.Should().Be(original.Porcentaje); @@ -197,7 +197,7 @@ public class TipoDeIvaTests { var original = MakeTipoDeIva(activo: false); - var reactivated = original.Reactivate(); + var reactivated = original.Reactivate(DateTime.UtcNow); reactivated.Activo.Should().BeTrue(); } @@ -208,7 +208,7 @@ public class TipoDeIvaTests var original = MakeTipoDeIva(vigenciaHasta: null); var hasta = new DateOnly(2026, 5, 31); - var cerrado = original.CerrarVigencia(hasta); + var cerrado = original.CerrarVigencia(hasta, DateTime.UtcNow); cerrado.VigenciaHasta.Should().Be(hasta); cerrado.Porcentaje.Should().Be(original.Porcentaje); @@ -222,7 +222,7 @@ public class TipoDeIvaTests { var predecesora = MakeTipoDeIva(id: 5, porcentaje: 21m, vigenciaDesde: Desde2020, vigenciaHasta: null); - var (cerrada, nueva) = predecesora.NuevaVersion(23.5m, Desde2026); + var (cerrada, nueva) = predecesora.NuevaVersion(23.5m, Desde2026, DateTime.UtcNow); cerrada.Id.Should().Be(5); cerrada.VigenciaHasta.Should().Be(Desde2026.AddDays(-1), "predecesora queda cerrada el día anterior"); @@ -244,7 +244,7 @@ public class TipoDeIvaTests var predecesora = MakeTipoDeIva(porcentaje: 10.5m, vigenciaDesde: Desde2020); var nuevaVigencia = new DateOnly(2025, 1, 1); - var (_, nueva) = predecesora.NuevaVersion(21m, nuevaVigencia); + var (_, nueva) = predecesora.NuevaVersion(21m, nuevaVigencia, DateTime.UtcNow); nueva.Porcentaje.Should().Be(21m); predecesora.Porcentaje.Should().Be(10.5m, "predecesora no muta"); @@ -259,7 +259,7 @@ public class TipoDeIvaTests vigenciaDesde: Desde2020, vigenciaHasta: new DateOnly(2025, 12, 31)); // ya cerrada - var act = () => predecesora.NuevaVersion(23.5m, Desde2026); + var act = () => predecesora.NuevaVersion(23.5m, Desde2026, DateTime.UtcNow); act.Should().Throw(); } @@ -269,7 +269,7 @@ public class TipoDeIvaTests { var predecesora = MakeTipoDeIva(vigenciaDesde: Desde2020, vigenciaHasta: null); - var act = () => predecesora.NuevaVersion(23.5m, Desde2020); // igual a VigenciaDesde predecesora + var act = () => predecesora.NuevaVersion(23.5m, Desde2020, DateTime.UtcNow); // igual a VigenciaDesde predecesora act.Should().Throw() .WithParameterName("vigenciaDesde"); @@ -281,7 +281,7 @@ public class TipoDeIvaTests var predecesora = MakeTipoDeIva(vigenciaDesde: Desde2026, vigenciaHasta: null); var vigenciaAnterior = new DateOnly(2020, 1, 1); - var act = () => predecesora.NuevaVersion(23.5m, vigenciaAnterior); + var act = () => predecesora.NuevaVersion(23.5m, vigenciaAnterior, DateTime.UtcNow); act.Should().Throw() .WithParameterName("vigenciaDesde"); @@ -292,7 +292,7 @@ public class TipoDeIvaTests { var predecesora = MakeTipoDeIva(vigenciaDesde: Desde2020, vigenciaHasta: null); - var act = () => predecesora.NuevaVersion(-1m, Desde2026); + var act = () => predecesora.NuevaVersion(-1m, Desde2026, DateTime.UtcNow); act.Should().Throw() .WithParameterName("nuevoPorcentaje"); @@ -303,7 +303,7 @@ public class TipoDeIvaTests { var predecesora = MakeTipoDeIva(vigenciaDesde: Desde2020, vigenciaHasta: null); - var act = () => predecesora.NuevaVersion(101m, Desde2026); + var act = () => predecesora.NuevaVersion(101m, Desde2026, DateTime.UtcNow); act.Should().Throw() .WithParameterName("nuevoPorcentaje"); @@ -326,7 +326,7 @@ public class TipoDeIvaTests { var original = MakeTipoDeIva(id: 99, porcentaje: 21m, vigenciaDesde: Desde2020); - var updated = original.WithDescripcion("Nueva"); + var updated = original.WithDescripcion("Nueva", DateTime.UtcNow); updated.Id.Should().Be(99); updated.Porcentaje.Should().Be(21m); diff --git a/tests/SIGCM2.Application.Tests/Domain/PuntoDeVentaTests.cs b/tests/SIGCM2.Application.Tests/Domain/PuntoDeVentaTests.cs index 57409cf..9061427 100644 --- a/tests/SIGCM2.Application.Tests/Domain/PuntoDeVentaTests.cs +++ b/tests/SIGCM2.Application.Tests/Domain/PuntoDeVentaTests.cs @@ -43,7 +43,7 @@ public class PuntoDeVentaTests { var original = MakePdv(id: 10, nombre: "Original"); - var updated = original.WithUpdatedProfile(nombre: "Actualizado", numeroAFIP: 7, descripcion: "Desc"); + var updated = original.WithUpdatedProfile(nombre: "Actualizado", numeroAFIP: 7, descripcion: "Desc", now: DateTime.UtcNow); Assert.NotSame(original, updated); Assert.Equal("Actualizado", updated.Nombre); @@ -56,7 +56,7 @@ public class PuntoDeVentaTests { var original = MakePdv(id: 10, medioId: 5); - var updated = original.WithUpdatedProfile("Nuevo", 2, null); + var updated = original.WithUpdatedProfile("Nuevo", 2, null, DateTime.UtcNow); Assert.Equal(10, updated.Id); Assert.Equal(5, updated.MedioId); @@ -69,7 +69,7 @@ public class PuntoDeVentaTests { var original = MakePdv(); - var updated = original.WithUpdatedProfile("Nuevo", 2, null); + var updated = original.WithUpdatedProfile("Nuevo", 2, null, DateTime.UtcNow); Assert.NotNull(updated.FechaModificacion); } @@ -81,7 +81,7 @@ public class PuntoDeVentaTests { var pdv = MakePdv(activo: true); - var deactivated = pdv.WithActivo(false); + var deactivated = pdv.WithActivo(false, DateTime.UtcNow); Assert.False(deactivated.Activo); Assert.NotSame(pdv, deactivated); @@ -92,7 +92,7 @@ public class PuntoDeVentaTests { var pdv = MakePdv(activo: false); - var reactivated = pdv.WithActivo(true); + var reactivated = pdv.WithActivo(true, DateTime.UtcNow); Assert.True(reactivated.Activo); } @@ -102,7 +102,7 @@ public class PuntoDeVentaTests { var pdv = MakePdv(id: 99, medioId: 3); - var toggled = pdv.WithActivo(false); + var toggled = pdv.WithActivo(false, DateTime.UtcNow); Assert.Equal(99, toggled.Id); Assert.Equal(3, toggled.MedioId); diff --git a/tests/SIGCM2.Application.Tests/Domain/UsuarioTests.cs b/tests/SIGCM2.Application.Tests/Domain/UsuarioTests.cs index ee28ce7..eb1c2c0 100644 --- a/tests/SIGCM2.Application.Tests/Domain/UsuarioTests.cs +++ b/tests/SIGCM2.Application.Tests/Domain/UsuarioTests.cs @@ -101,7 +101,7 @@ public class UsuarioTests public void WithUpdatedProfile_Returns_NewInstance() { var u = MakeUsuario(); - var updated = u.WithUpdatedProfile("NuevoNombre", "NuevoApellido", "new@x.com", "cajero", true); + var updated = u.WithUpdatedProfile("NuevoNombre", "NuevoApellido", "new@x.com", "cajero", true, DateTime.UtcNow); Assert.NotSame(u, updated); } @@ -109,7 +109,7 @@ public class UsuarioTests public void WithUpdatedProfile_Sets_Fields_Correctly() { var u = MakeUsuario(); - var updated = u.WithUpdatedProfile("Pedro", "Gómez", "p@g.com", "cajero", false); + var updated = u.WithUpdatedProfile("Pedro", "Gómez", "p@g.com", "cajero", false, DateTime.UtcNow); Assert.Equal("Pedro", updated.Nombre); Assert.Equal("Gómez", updated.Apellido); Assert.Equal("p@g.com", updated.Email); @@ -121,8 +121,9 @@ public class UsuarioTests public void WithUpdatedProfile_Sets_FechaModificacion_To_UtcNow() { var before = DateTime.UtcNow.AddSeconds(-1); + var now = DateTime.UtcNow; var u = MakeUsuario(); - var updated = u.WithUpdatedProfile("A", "B", null, "admin", true); + var updated = u.WithUpdatedProfile("A", "B", null, "admin", true, now); Assert.NotNull(updated.FechaModificacion); Assert.True(updated.FechaModificacion >= before); } @@ -131,7 +132,7 @@ public class UsuarioTests public void WithUpdatedProfile_Preserves_Immutable_Fields() { var u = MakeUsuario(); - var updated = u.WithUpdatedProfile("X", "Y", null, "cajero", true); + var updated = u.WithUpdatedProfile("X", "Y", null, "cajero", true, DateTime.UtcNow); Assert.Equal(u.Id, updated.Id); Assert.Equal(u.Username, updated.Username); Assert.Equal(u.PasswordHash, updated.PasswordHash); @@ -143,7 +144,7 @@ public class UsuarioTests public void WithNewPasswordHash_Returns_NewInstance() { var u = MakeUsuario(); - var updated = u.WithNewPasswordHash("newhash", mustChangePassword: false); + var updated = u.WithNewPasswordHash("newhash", mustChangePassword: false, DateTime.UtcNow); Assert.NotSame(u, updated); } @@ -151,7 +152,7 @@ public class UsuarioTests public void WithNewPasswordHash_Sets_Hash_And_MustChange() { var u = MakeUsuario(); - var updated = u.WithNewPasswordHash("newhash", mustChangePassword: true); + var updated = u.WithNewPasswordHash("newhash", mustChangePassword: true, DateTime.UtcNow); Assert.Equal("newhash", updated.PasswordHash); Assert.True(updated.MustChangePassword); } @@ -160,7 +161,7 @@ public class UsuarioTests public void WithNewPasswordHash_Clears_MustChange_When_False() { var u = MakeUsuario(mustChangePassword: true); - var updated = u.WithNewPasswordHash("hash2", mustChangePassword: false); + var updated = u.WithNewPasswordHash("hash2", mustChangePassword: false, DateTime.UtcNow); Assert.False(updated.MustChangePassword); } @@ -168,8 +169,9 @@ public class UsuarioTests public void WithNewPasswordHash_Sets_FechaModificacion() { var before = DateTime.UtcNow.AddSeconds(-1); + var now = DateTime.UtcNow; var u = MakeUsuario(); - var updated = u.WithNewPasswordHash("hash2", false); + var updated = u.WithNewPasswordHash("hash2", false, now); Assert.NotNull(updated.FechaModificacion); Assert.True(updated.FechaModificacion >= before); } @@ -208,7 +210,7 @@ public class UsuarioTests public void WithMustChangePassword_Sets_Value_True() { var u = MakeUsuario(mustChangePassword: false); - var updated = u.WithMustChangePassword(true); + var updated = u.WithMustChangePassword(true, DateTime.UtcNow); Assert.True(updated.MustChangePassword); } @@ -216,8 +218,9 @@ public class UsuarioTests public void WithMustChangePassword_Sets_FechaModificacion() { var before = DateTime.UtcNow.AddSeconds(-1); + var now = DateTime.UtcNow; var u = MakeUsuario(); - var updated = u.WithMustChangePassword(true); + var updated = u.WithMustChangePassword(true, now); Assert.NotNull(updated.FechaModificacion); Assert.True(updated.FechaModificacion >= before); } diff --git a/tests/SIGCM2.Application.Tests/Infrastructure/Audit/AuditLoggerTests.cs b/tests/SIGCM2.Application.Tests/Infrastructure/Audit/AuditLoggerTests.cs index 6dc1615..a0f52d7 100644 --- a/tests/SIGCM2.Application.Tests/Infrastructure/Audit/AuditLoggerTests.cs +++ b/tests/SIGCM2.Application.Tests/Infrastructure/Audit/AuditLoggerTests.cs @@ -22,7 +22,7 @@ public sealed class AuditLoggerTests repo ??= Substitute.For(); options ??= new AuditOptions(); var optsWrapper = Options.Create(options); - return new AuditLogger(context, repo, optsWrapper); + return new AuditLogger(context, repo, optsWrapper, TimeProvider.System); } [Fact] diff --git a/tests/SIGCM2.Application.Tests/Infrastructure/Audit/SecurityEventLoggerTests.cs b/tests/SIGCM2.Application.Tests/Infrastructure/Audit/SecurityEventLoggerTests.cs index 45ca6fb..455e873 100644 --- a/tests/SIGCM2.Application.Tests/Infrastructure/Audit/SecurityEventLoggerTests.cs +++ b/tests/SIGCM2.Application.Tests/Infrastructure/Audit/SecurityEventLoggerTests.cs @@ -20,7 +20,7 @@ public sealed class SecurityEventLoggerTests repo ??= Substitute.For(); context ??= Substitute.For(); options ??= new AuditOptions(); - return new SecurityEventLogger(repo, context, Options.Create(options)); + return new SecurityEventLogger(repo, context, Options.Create(options), TimeProvider.System); } [Fact] diff --git a/tests/SIGCM2.Application.Tests/Infrastructure/JwtServiceTests.cs b/tests/SIGCM2.Application.Tests/Infrastructure/JwtServiceTests.cs index c080c8f..620996d 100644 --- a/tests/SIGCM2.Application.Tests/Infrastructure/JwtServiceTests.cs +++ b/tests/SIGCM2.Application.Tests/Infrastructure/JwtServiceTests.cs @@ -22,7 +22,7 @@ public class JwtServiceTests : IDisposable Audience = "sigcm2.web", AccessTokenMinutes = 60 }; - _jwtService = new JwtService(_rsa, _options); + _jwtService = new JwtService(_rsa, _options, TimeProvider.System); } public void Dispose() => _rsa.Dispose(); @@ -219,7 +219,7 @@ public class JwtServiceTests : IDisposable // Sign with a different RSA key using var otherRsa = System.Security.Cryptography.RSA.Create(2048); var otherOptions = new JwtOptions { Issuer = "sigcm2.api", Audience = "sigcm2.web", AccessTokenMinutes = 60 }; - var otherService = new JwtService(otherRsa, otherOptions); + var otherService = new JwtService(otherRsa, otherOptions, TimeProvider.System); var tokenFromOtherKey = otherService.GenerateAccessToken(MakeUsuario()); // Validating with the correct key should throw diff --git a/tests/SIGCM2.Application.Tests/IngresosBrutos/Create/CreateIngresosBrutosCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/IngresosBrutos/Create/CreateIngresosBrutosCommandHandlerTests.cs index 437f152..0ce53ed 100644 --- a/tests/SIGCM2.Application.Tests/IngresosBrutos/Create/CreateIngresosBrutosCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/IngresosBrutos/Create/CreateIngresosBrutosCommandHandlerTests.cs @@ -21,7 +21,7 @@ public class CreateIngresosBrutosCommandHandlerTests public CreateIngresosBrutosCommandHandlerTests() { - _handler = new CreateIngresosBrutosCommandHandler(_repo, _audit); + _handler = new CreateIngresosBrutosCommandHandler(_repo, _audit, TimeProvider.System); _repo.InsertAsync(Arg.Any(), Arg.Any()).Returns(55); } diff --git a/tests/SIGCM2.Application.Tests/IngresosBrutos/Deactivate/DeactivateIngresosBrutosCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/IngresosBrutos/Deactivate/DeactivateIngresosBrutosCommandHandlerTests.cs index 7e70669..30d88bf 100644 --- a/tests/SIGCM2.Application.Tests/IngresosBrutos/Deactivate/DeactivateIngresosBrutosCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/IngresosBrutos/Deactivate/DeactivateIngresosBrutosCommandHandlerTests.cs @@ -24,7 +24,7 @@ public class DeactivateIngresosBrutosCommandHandlerTests public DeactivateIngresosBrutosCommandHandlerTests() { - _handler = new DeactivateIngresosBrutosCommandHandler(_repo, _audit); + _handler = new DeactivateIngresosBrutosCommandHandler(_repo, _audit, TimeProvider.System); _repo.GetByIdAsync(1, Arg.Any()).Returns(MakeEntity()); _repo.SetActivoAsync(Arg.Any(), Arg.Any(), Arg.Any()).Returns(true); } diff --git a/tests/SIGCM2.Application.Tests/IngresosBrutos/NuevaVersion/NuevaVersionIngresosBrutosCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/IngresosBrutos/NuevaVersion/NuevaVersionIngresosBrutosCommandHandlerTests.cs index 15570a5..3bdab42 100644 --- a/tests/SIGCM2.Application.Tests/IngresosBrutos/NuevaVersion/NuevaVersionIngresosBrutosCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/IngresosBrutos/NuevaVersion/NuevaVersionIngresosBrutosCommandHandlerTests.cs @@ -31,7 +31,7 @@ public class NuevaVersionIngresosBrutosCommandHandlerTests public NuevaVersionIngresosBrutosCommandHandlerTests() { - _handler = new NuevaVersionIngresosBrutosCommandHandler(_repo, _audit); + _handler = new NuevaVersionIngresosBrutosCommandHandler(_repo, _audit, TimeProvider.System); _repo.GetByIdAsync(1, Arg.Any()).Returns(MakePredecesora()); _repo.UpdateCierreVigenciaAsync(Arg.Any(), Arg.Any(), Arg.Any()).Returns(true); _repo.InsertAsync(Arg.Any(), Arg.Any()).Returns(88); diff --git a/tests/SIGCM2.Application.Tests/IngresosBrutos/Reactivate/ReactivateIngresosBrutosCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/IngresosBrutos/Reactivate/ReactivateIngresosBrutosCommandHandlerTests.cs index f291764..3cac630 100644 --- a/tests/SIGCM2.Application.Tests/IngresosBrutos/Reactivate/ReactivateIngresosBrutosCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/IngresosBrutos/Reactivate/ReactivateIngresosBrutosCommandHandlerTests.cs @@ -24,7 +24,7 @@ public class ReactivateIngresosBrutosCommandHandlerTests public ReactivateIngresosBrutosCommandHandlerTests() { - _handler = new ReactivateIngresosBrutosCommandHandler(_repo, _audit); + _handler = new ReactivateIngresosBrutosCommandHandler(_repo, _audit, TimeProvider.System); _repo.GetByIdAsync(1, Arg.Any()).Returns(MakeEntity()); _repo.SetActivoAsync(Arg.Any(), Arg.Any(), Arg.Any()).Returns(true); } diff --git a/tests/SIGCM2.Application.Tests/IngresosBrutos/Update/UpdateIngresosBrutosCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/IngresosBrutos/Update/UpdateIngresosBrutosCommandHandlerTests.cs index a072775..bdf407c 100644 --- a/tests/SIGCM2.Application.Tests/IngresosBrutos/Update/UpdateIngresosBrutosCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/IngresosBrutos/Update/UpdateIngresosBrutosCommandHandlerTests.cs @@ -27,7 +27,7 @@ public class UpdateIngresosBrutosCommandHandlerTests public UpdateIngresosBrutosCommandHandlerTests() { - _handler = new UpdateIngresosBrutosCommandHandler(_repo, _audit); + _handler = new UpdateIngresosBrutosCommandHandler(_repo, _audit, TimeProvider.System); _repo.GetByIdAsync(1, Arg.Any()).Returns(MakeEntity()); _repo.UpdateCosmeticoAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()).Returns(true); diff --git a/tests/SIGCM2.Application.Tests/Medios/Deactivate/DeactivateMedioCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Medios/Deactivate/DeactivateMedioCommandHandlerTests.cs index ff1c94f..2a0cf8c 100644 --- a/tests/SIGCM2.Application.Tests/Medios/Deactivate/DeactivateMedioCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Medios/Deactivate/DeactivateMedioCommandHandlerTests.cs @@ -18,7 +18,7 @@ public class DeactivateMedioCommandHandlerTests public DeactivateMedioCommandHandlerTests() { - _handler = new DeactivateMedioCommandHandler(_repo, _audit); + _handler = new DeactivateMedioCommandHandler(_repo, _audit, TimeProvider.System); } // ── not found → throws ────────────────────────────────────────────────── diff --git a/tests/SIGCM2.Application.Tests/Medios/MedioRepositoryTests.cs b/tests/SIGCM2.Application.Tests/Medios/MedioRepositoryTests.cs index 3a7dafd..80c9fdf 100644 --- a/tests/SIGCM2.Application.Tests/Medios/MedioRepositoryTests.cs +++ b/tests/SIGCM2.Application.Tests/Medios/MedioRepositoryTests.cs @@ -148,7 +148,7 @@ public class MedioRepositoryTests : IAsyncLifetime var id = await _repository.AddAsync(Medio.ForCreation("UPD01", "Original", TipoMedio.Diario, null)); var original = await _repository.GetByIdAsync(id); - var updated = original!.WithUpdatedProfile("Actualizado", TipoMedio.Radio, 7); + var updated = original!.WithUpdatedProfile("Actualizado", TipoMedio.Radio, 7, DateTime.UtcNow); await _repository.UpdateAsync(updated); var result = await _repository.GetByIdAsync(id); @@ -167,7 +167,7 @@ public class MedioRepositoryTests : IAsyncLifetime var id = await _repository.AddAsync(Medio.ForCreation("HIST01", "Historial", TipoMedio.Diario, null)); var original = await _repository.GetByIdAsync(id); - var updated = original!.WithUpdatedProfile("Historial v2", TipoMedio.Web, null); + var updated = original!.WithUpdatedProfile("Historial v2", TipoMedio.Web, null, DateTime.UtcNow); await _repository.UpdateAsync(updated); var historyCount = await _connection.ExecuteScalarAsync( @@ -186,7 +186,7 @@ public class MedioRepositoryTests : IAsyncLifetime // Deactivate second medio var inact = await _repository.GetByIdAsync(idInact); - await _repository.UpdateAsync(inact!.WithActivo(false)); + await _repository.UpdateAsync(inact!.WithActivo(false, DateTime.UtcNow)); var result = await _repository.GetPagedAsync(new(Page: 1, PageSize: 50, Activo: true, Tipo: null, Search: null)); diff --git a/tests/SIGCM2.Application.Tests/Medios/Reactivate/ReactivateMedioCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Medios/Reactivate/ReactivateMedioCommandHandlerTests.cs index ac7dd12..5267b79 100644 --- a/tests/SIGCM2.Application.Tests/Medios/Reactivate/ReactivateMedioCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Medios/Reactivate/ReactivateMedioCommandHandlerTests.cs @@ -19,7 +19,7 @@ public class ReactivateMedioCommandHandlerTests public ReactivateMedioCommandHandlerTests() { - _handler = new ReactivateMedioCommandHandler(_repo, _audit); + _handler = new ReactivateMedioCommandHandler(_repo, _audit, TimeProvider.System); } // ── not found → throws ────────────────────────────────────────────────── diff --git a/tests/SIGCM2.Application.Tests/Medios/Update/UpdateMedioCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Medios/Update/UpdateMedioCommandHandlerTests.cs index e96aa4c..90c8316 100644 --- a/tests/SIGCM2.Application.Tests/Medios/Update/UpdateMedioCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Medios/Update/UpdateMedioCommandHandlerTests.cs @@ -24,7 +24,7 @@ public class UpdateMedioCommandHandlerTests public UpdateMedioCommandHandlerTests() { - _handler = new UpdateMedioCommandHandler(_repo, _audit); + _handler = new UpdateMedioCommandHandler(_repo, _audit, TimeProvider.System); } // ── not found → throws ────────────────────────────────────────────────── diff --git a/tests/SIGCM2.Application.Tests/PuntosDeVenta/Deactivate/DeactivatePuntoDeVentaCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/PuntosDeVenta/Deactivate/DeactivatePuntoDeVentaCommandHandlerTests.cs index 5ac8a93..9308898 100644 --- a/tests/SIGCM2.Application.Tests/PuntosDeVenta/Deactivate/DeactivatePuntoDeVentaCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/PuntosDeVenta/Deactivate/DeactivatePuntoDeVentaCommandHandlerTests.cs @@ -22,7 +22,7 @@ public class DeactivatePuntoDeVentaCommandHandlerTests public DeactivatePuntoDeVentaCommandHandlerTests() { - _handler = new DeactivatePuntoDeVentaCommandHandler(_repo, _medioRepo, _audit); + _handler = new DeactivatePuntoDeVentaCommandHandler(_repo, _medioRepo, _audit, TimeProvider.System); _medioRepo.GetByIdAsync(Arg.Any(), Arg.Any()).Returns(MakeMedio(5, true)); } diff --git a/tests/SIGCM2.Application.Tests/PuntosDeVenta/Reactivate/ReactivatePuntoDeVentaCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/PuntosDeVenta/Reactivate/ReactivatePuntoDeVentaCommandHandlerTests.cs index b810d82..6eca8b1 100644 --- a/tests/SIGCM2.Application.Tests/PuntosDeVenta/Reactivate/ReactivatePuntoDeVentaCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/PuntosDeVenta/Reactivate/ReactivatePuntoDeVentaCommandHandlerTests.cs @@ -23,7 +23,7 @@ public class ReactivatePuntoDeVentaCommandHandlerTests public ReactivatePuntoDeVentaCommandHandlerTests() { - _handler = new ReactivatePuntoDeVentaCommandHandler(_repo, _medioRepo, _audit); + _handler = new ReactivatePuntoDeVentaCommandHandler(_repo, _medioRepo, _audit, TimeProvider.System); _medioRepo.GetByIdAsync(Arg.Any(), Arg.Any()).Returns(MakeMedio(5, true)); } diff --git a/tests/SIGCM2.Application.Tests/PuntosDeVenta/Update/UpdatePuntoDeVentaCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/PuntosDeVenta/Update/UpdatePuntoDeVentaCommandHandlerTests.cs index 1724e35..22d9d2a 100644 --- a/tests/SIGCM2.Application.Tests/PuntosDeVenta/Update/UpdatePuntoDeVentaCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/PuntosDeVenta/Update/UpdatePuntoDeVentaCommandHandlerTests.cs @@ -25,7 +25,7 @@ public class UpdatePuntoDeVentaCommandHandlerTests public UpdatePuntoDeVentaCommandHandlerTests() { - _handler = new UpdatePuntoDeVentaCommandHandler(_repo, _medioRepo, _audit); + _handler = new UpdatePuntoDeVentaCommandHandler(_repo, _medioRepo, _audit, TimeProvider.System); _repo.GetByIdAsync(10, Arg.Any()).Returns(MakePdv(10)); _medioRepo.GetByIdAsync(5, Arg.Any()).Returns(MakeMedio(5)); _repo.ExistsByNumeroAFIPInMedioAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()).Returns(false); diff --git a/tests/SIGCM2.Application.Tests/Secciones/Deactivate/DeactivateSeccionCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Secciones/Deactivate/DeactivateSeccionCommandHandlerTests.cs index 3b355c7..6d0a50d 100644 --- a/tests/SIGCM2.Application.Tests/Secciones/Deactivate/DeactivateSeccionCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Secciones/Deactivate/DeactivateSeccionCommandHandlerTests.cs @@ -22,7 +22,7 @@ public class DeactivateSeccionCommandHandlerTests public DeactivateSeccionCommandHandlerTests() { - _handler = new DeactivateSeccionCommandHandler(_repo, _medioRepo, _audit); + _handler = new DeactivateSeccionCommandHandler(_repo, _medioRepo, _audit, TimeProvider.System); // Default: medio is active _medioRepo.GetByIdAsync(Arg.Any(), Arg.Any()).Returns(MakeMedio(1, true)); } diff --git a/tests/SIGCM2.Application.Tests/Secciones/Reactivate/ReactivateSeccionCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Secciones/Reactivate/ReactivateSeccionCommandHandlerTests.cs index 1c8f978..84e4b12 100644 --- a/tests/SIGCM2.Application.Tests/Secciones/Reactivate/ReactivateSeccionCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Secciones/Reactivate/ReactivateSeccionCommandHandlerTests.cs @@ -23,7 +23,7 @@ public class ReactivateSeccionCommandHandlerTests public ReactivateSeccionCommandHandlerTests() { - _handler = new ReactivateSeccionCommandHandler(_repo, _medioRepo, _audit); + _handler = new ReactivateSeccionCommandHandler(_repo, _medioRepo, _audit, TimeProvider.System); // Default: medio is active _medioRepo.GetByIdAsync(Arg.Any(), Arg.Any()).Returns(MakeMedio(1, true)); } diff --git a/tests/SIGCM2.Application.Tests/Secciones/SeccionRepositoryTests.cs b/tests/SIGCM2.Application.Tests/Secciones/SeccionRepositoryTests.cs index 5f7a000..541fb13 100644 --- a/tests/SIGCM2.Application.Tests/Secciones/SeccionRepositoryTests.cs +++ b/tests/SIGCM2.Application.Tests/Secciones/SeccionRepositoryTests.cs @@ -150,7 +150,7 @@ public class SeccionRepositoryTests : IAsyncLifetime var id = await _repository.AddAsync(Seccion.ForCreation(_medioId, "UPD01", "Original", "clasificados")); var original = await _repository.GetByIdAsync(id); - var updated = original!.WithUpdatedProfile("Actualizado", "notables"); + var updated = original!.WithUpdatedProfile("Actualizado", "notables", DateTime.UtcNow); await _repository.UpdateAsync(updated); var result = await _repository.GetByIdAsync(id); @@ -168,7 +168,7 @@ public class SeccionRepositoryTests : IAsyncLifetime var id = await _repository.AddAsync(Seccion.ForCreation(_medioId, "HIST01", "Historial", "clasificados")); var original = await _repository.GetByIdAsync(id); - var updated = original!.WithUpdatedProfile("Historial v2", "suplementos"); + var updated = original!.WithUpdatedProfile("Historial v2", "suplementos", DateTime.UtcNow); await _repository.UpdateAsync(updated); var historyCount = await _connection.ExecuteScalarAsync( @@ -213,7 +213,7 @@ public class SeccionRepositoryTests : IAsyncLifetime var inactId = await _repository.AddAsync(Seccion.ForCreation(_medioId, "INACT01", "Inactiva", "clasificados")); var inact = await _repository.GetByIdAsync(inactId); - await _repository.UpdateAsync(inact!.WithActivo(false)); + await _repository.UpdateAsync(inact!.WithActivo(false, DateTime.UtcNow)); var result = await _repository.GetPagedAsync(new(Page: 1, PageSize: 50, MedioId: _medioId, Tipo: null, Activo: true, Search: null)); diff --git a/tests/SIGCM2.Application.Tests/Secciones/Update/UpdateSeccionCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Secciones/Update/UpdateSeccionCommandHandlerTests.cs index 1f8764e..458b02b 100644 --- a/tests/SIGCM2.Application.Tests/Secciones/Update/UpdateSeccionCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Secciones/Update/UpdateSeccionCommandHandlerTests.cs @@ -27,7 +27,7 @@ public class UpdateSeccionCommandHandlerTests public UpdateSeccionCommandHandlerTests() { - _handler = new UpdateSeccionCommandHandler(_repo, _medioRepo, _audit); + _handler = new UpdateSeccionCommandHandler(_repo, _medioRepo, _audit, TimeProvider.System); // Default: medio is active _medioRepo.GetByIdAsync(Arg.Any(), Arg.Any()).Returns(MakeMedio(1, true)); } diff --git a/tests/SIGCM2.Application.Tests/TiposDeIva/Create/CreateTipoDeIvaCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/TiposDeIva/Create/CreateTipoDeIvaCommandHandlerTests.cs index 4eb8259..667ffce 100644 --- a/tests/SIGCM2.Application.Tests/TiposDeIva/Create/CreateTipoDeIvaCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/TiposDeIva/Create/CreateTipoDeIvaCommandHandlerTests.cs @@ -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(), Arg.Any()).Returns(42); } diff --git a/tests/SIGCM2.Application.Tests/TiposDeIva/Deactivate/DeactivateTipoDeIvaCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/TiposDeIva/Deactivate/DeactivateTipoDeIvaCommandHandlerTests.cs index 5c1e887..aebce83 100644 --- a/tests/SIGCM2.Application.Tests/TiposDeIva/Deactivate/DeactivateTipoDeIvaCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/TiposDeIva/Deactivate/DeactivateTipoDeIvaCommandHandlerTests.cs @@ -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()).Returns(MakeEntity()); _repo.SetActivoAsync(Arg.Any(), Arg.Any(), Arg.Any()).Returns(true); } diff --git a/tests/SIGCM2.Application.Tests/TiposDeIva/NuevaVersion/NuevaVersionTipoDeIvaCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/TiposDeIva/NuevaVersion/NuevaVersionTipoDeIvaCommandHandlerTests.cs index f569d7f..96bdb97 100644 --- a/tests/SIGCM2.Application.Tests/TiposDeIva/NuevaVersion/NuevaVersionTipoDeIvaCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/TiposDeIva/NuevaVersion/NuevaVersionTipoDeIvaCommandHandlerTests.cs @@ -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()).Returns(MakePredecesora()); _repo.UpdateCierreVigenciaAsync(Arg.Any(), Arg.Any(), Arg.Any()) .Returns(true); diff --git a/tests/SIGCM2.Application.Tests/TiposDeIva/Reactivate/ReactivateTipoDeIvaCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/TiposDeIva/Reactivate/ReactivateTipoDeIvaCommandHandlerTests.cs index a930e54..1bb5634 100644 --- a/tests/SIGCM2.Application.Tests/TiposDeIva/Reactivate/ReactivateTipoDeIvaCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/TiposDeIva/Reactivate/ReactivateTipoDeIvaCommandHandlerTests.cs @@ -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()).Returns(MakeEntity()); _repo.SetActivoAsync(Arg.Any(), Arg.Any(), Arg.Any()).Returns(true); } diff --git a/tests/SIGCM2.Application.Tests/TiposDeIva/Update/UpdateTipoDeIvaCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/TiposDeIva/Update/UpdateTipoDeIvaCommandHandlerTests.cs index 240a8ae..3b99d2f 100644 --- a/tests/SIGCM2.Application.Tests/TiposDeIva/Update/UpdateTipoDeIvaCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/TiposDeIva/Update/UpdateTipoDeIvaCommandHandlerTests.cs @@ -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()).Returns(MakeEntity()); _repo.UpdateCosmeticoAsync(Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any(), Arg.Any()) diff --git a/tests/SIGCM2.Application.Tests/Usuarios/DeactivateUsuarioCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Usuarios/DeactivateUsuarioCommandHandlerTests.cs index 7d7a69c..5b35819 100644 --- a/tests/SIGCM2.Application.Tests/Usuarios/DeactivateUsuarioCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Usuarios/DeactivateUsuarioCommandHandlerTests.cs @@ -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()).Returns(2); } diff --git a/tests/SIGCM2.Application.Tests/Usuarios/ReactivateUsuarioCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Usuarios/ReactivateUsuarioCommandHandlerTests.cs index bceb7cd..a0cd42f 100644 --- a/tests/SIGCM2.Application.Tests/Usuarios/ReactivateUsuarioCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Usuarios/ReactivateUsuarioCommandHandlerTests.cs @@ -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) diff --git a/tests/SIGCM2.Application.Tests/Usuarios/ResetUsuarioPasswordCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Usuarios/ResetUsuarioPasswordCommandHandlerTests.cs index d0b0ab2..dc807e9 100644 --- a/tests/SIGCM2.Application.Tests/Usuarios/ResetUsuarioPasswordCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Usuarios/ResetUsuarioPasswordCommandHandlerTests.cs @@ -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()).Returns(args => "$2a$12$hashof_" + args[0]); } diff --git a/tests/SIGCM2.Application.Tests/Usuarios/UpdateUsuarioCommandHandlerTests.cs b/tests/SIGCM2.Application.Tests/Usuarios/UpdateUsuarioCommandHandlerTests.cs index b634c72..fc5a6ab 100644 --- a/tests/SIGCM2.Application.Tests/Usuarios/UpdateUsuarioCommandHandlerTests.cs +++ b/tests/SIGCM2.Application.Tests/Usuarios/UpdateUsuarioCommandHandlerTests.cs @@ -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(), Arg.Any()).Returns(true);