diff --git a/src/Identity/test/Identity.Test/SecurityStampValidatorTest.cs b/src/Identity/test/Identity.Test/SecurityStampValidatorTest.cs index 9a22add05c0a..663b7dc807b8 100644 --- a/src/Identity/test/Identity.Test/SecurityStampValidatorTest.cs +++ b/src/Identity/test/Identity.Test/SecurityStampValidatorTest.cs @@ -285,7 +285,11 @@ public async Task OnValidateIdentityDoesNotExtendExpirationWhenSlidingIsDisabled var services = new ServiceCollection(); services.AddSingleton(options.Object); services.AddSingleton(signInManager.Object); - var clock = new SystemClock(); + var clock = new TestClock() + { + // Second precision + UtcNow = new DateTimeOffset(2013, 6, 11, 12, 34, 56, 0, TimeSpan.Zero) + }; services.AddSingleton(new SecurityStampValidator(options.Object, signInManager.Object, clock, new LoggerFactory())); httpContext.Setup(c => c.RequestServices).Returns(services.BuildServiceProvider()); var id = new ClaimsIdentity(IdentityConstants.ApplicationScheme); diff --git a/src/Identity/test/InMemory.Test/TestClock.cs b/src/Identity/test/Shared/TestClock.cs similarity index 91% rename from src/Identity/test/InMemory.Test/TestClock.cs rename to src/Identity/test/Shared/TestClock.cs index 3219f29a3934..6a5ad364f3ac 100644 --- a/src/Identity/test/InMemory.Test/TestClock.cs +++ b/src/Identity/test/Shared/TestClock.cs @@ -4,7 +4,7 @@ using System; using Microsoft.AspNetCore.Authentication; -namespace Microsoft.AspNetCore.Identity.InMemory +namespace Microsoft.AspNetCore.Identity.Test { public class TestClock : ISystemClock {