@@ -695,13 +695,16 @@ public async Task CanEagerRefreshAsync()
695695 Assert . Equal ( v5 , v6 ) ;
696696 }
697697
698- [ Fact ]
699- public async Task CanEagerRefreshWithInfiniteDurationAsync ( )
698+ [ Theory ]
699+ [ ClassData ( typeof ( MemoryLockerTypesClassData ) ) ]
700+ public async Task CanEagerRefreshWithInfiniteDurationAsync ( MemoryLockerType memoryLockerType )
700701 {
702+ var memoryLocker = TestsUtils . GetMemoryLocker ( memoryLockerType ) ;
703+
701704 var duration = TimeSpan . MaxValue ;
702705 var eagerRefreshThreshold = 0.5f ;
703706
704- using var cache = new FusionCache ( new FusionCacheOptions ( ) ) ;
707+ using var cache = new FusionCache ( new FusionCacheOptions ( ) , memoryLocker : memoryLocker ) ;
705708
706709 cache . DefaultEntryOptions . Duration = duration ;
707710 cache . DefaultEntryOptions . EagerRefreshThreshold = eagerRefreshThreshold ;
@@ -712,15 +715,18 @@ public async Task CanEagerRefreshWithInfiniteDurationAsync()
712715 Assert . True ( v1 > 0 ) ;
713716 }
714717
715- [ Fact ]
716- public async Task CanEagerRefreshNoCancellationAsync ( )
718+ [ Theory ]
719+ [ ClassData ( typeof ( MemoryLockerTypesClassData ) ) ]
720+ public async Task CanEagerRefreshNoCancellationAsync ( MemoryLockerType memoryLockerType )
717721 {
722+ var memoryLocker = TestsUtils . GetMemoryLocker ( memoryLockerType ) ;
723+
718724 var duration = TimeSpan . FromSeconds ( 2 ) ;
719725 var lockTimeout = TimeSpan . FromSeconds ( 10 ) ;
720726 var eagerRefreshThreshold = 0.1f ;
721727 var eagerRefreshDelay = TimeSpan . FromSeconds ( 5 ) ;
722728
723- using var cache = new FusionCache ( new FusionCacheOptions ( ) , logger : CreateXUnitLogger < FusionCache > ( ) ) ;
729+ using var cache = new FusionCache ( new FusionCacheOptions ( ) , memoryLocker : memoryLocker , logger : CreateXUnitLogger < FusionCache > ( ) ) ;
724730
725731 cache . DefaultEntryOptions . Duration = duration ;
726732 cache . DefaultEntryOptions . EagerRefreshThreshold = eagerRefreshThreshold ;
@@ -773,7 +779,7 @@ public async Task CanEagerRefreshNoCancellationAsync()
773779 {
774780 options . LockTimeout = lockTimeout ;
775781 }
776- , token : TestContext . Current . CancellationToken ) ;
782+ , token : TestContext . Current . CancellationToken ) ;
777783 sw . Stop ( ) ;
778784 var elapsedMs = sw . GetElapsedWithSafePad ( ) . TotalMilliseconds ;
779785
0 commit comments