11using System . Net ;
22using FluentAssertions ;
3- using FluentAssertions . Extensions ;
43using JsonApiDotNetCore . Configuration ;
54using JsonApiDotNetCore . Serialization . Objects ;
65using Microsoft . AspNetCore . Authentication ;
@@ -12,8 +11,6 @@ namespace JsonApiDotNetCoreTests.IntegrationTests.AtomicOperations.QueryStrings;
1211
1312public sealed class AtomicQueryStringTests : IClassFixture < IntegrationTestContext < TestableStartup < OperationsDbContext > , OperationsDbContext > >
1413{
15- private static readonly DateTime FrozenTime = 30 . July ( 2018 ) . At ( 13 , 46 , 12 ) . AsUtc ( ) ;
16-
1714 private readonly IntegrationTestContext < TestableStartup < OperationsDbContext > , OperationsDbContext > _testContext ;
1815 private readonly OperationsFakers _fakers = new ( ) ;
1916
@@ -26,11 +23,7 @@ public AtomicQueryStringTests(IntegrationTestContext<TestableStartup<OperationsD
2623
2724 testContext . ConfigureServicesAfterStartup ( services =>
2825 {
29- services . AddSingleton < ISystemClock > ( new FrozenSystemClock
30- {
31- UtcNow = FrozenTime
32- } ) ;
33-
26+ services . AddSingleton < ISystemClock , FrozenSystemClock > ( ) ;
3427 services . AddResourceDefinition < MusicTrackReleaseDefinition > ( ) ;
3528 } ) ;
3629 }
@@ -279,10 +272,12 @@ public async Task Cannot_use_sparse_fieldset_on_operations_endpoint()
279272 public async Task Can_use_Queryable_handler_on_resource_endpoint ( )
280273 {
281274 // Arrange
275+ var clock = _testContext . Factory . Services . GetRequiredService < ISystemClock > ( ) ;
276+
282277 List < MusicTrack > musicTracks = _fakers . MusicTrack . Generate ( 3 ) ;
283- musicTracks [ 0 ] . ReleasedAt = FrozenTime . AddMonths ( 5 ) ;
284- musicTracks [ 1 ] . ReleasedAt = FrozenTime . AddMonths ( - 5 ) ;
285- musicTracks [ 2 ] . ReleasedAt = FrozenTime . AddMonths ( - 1 ) ;
278+ musicTracks [ 0 ] . ReleasedAt = clock . UtcNow . AddMonths ( 5 ) ;
279+ musicTracks [ 1 ] . ReleasedAt = clock . UtcNow . AddMonths ( - 5 ) ;
280+ musicTracks [ 2 ] . ReleasedAt = clock . UtcNow . AddMonths ( - 1 ) ;
286281
287282 await _testContext . RunOnDatabaseAsync ( async dbContext =>
288283 {
0 commit comments