@@ -18,7 +18,7 @@ public class CacheAsyncSpecs : IDisposable
1818 [ Fact ]
1919 public void Should_throw_when_cache_provider_is_null ( )
2020 {
21- IAsyncCacheProvider cacheProvider = null ;
21+ IAsyncCacheProvider cacheProvider = null ! ;
2222 Action action = ( ) => Policy . CacheAsync ( cacheProvider , TimeSpan . MaxValue ) ;
2323 action . Should ( ) . Throw < ArgumentNullException > ( ) . And . ParamName . Should ( ) . Be ( "cacheProvider" ) ;
2424 }
@@ -27,7 +27,7 @@ public void Should_throw_when_cache_provider_is_null()
2727 public void Should_throw_when_ttl_strategy_is_null ( )
2828 {
2929 IAsyncCacheProvider cacheProvider = new StubCacheProvider ( ) ;
30- ITtlStrategy ttlStrategy = null ;
30+ ITtlStrategy ttlStrategy = null ! ;
3131 Action action = ( ) => Policy . CacheAsync ( cacheProvider , ttlStrategy ) ;
3232 action . Should ( ) . Throw < ArgumentNullException > ( ) . And . ParamName . Should ( ) . Be ( "ttlStrategy" ) ;
3333 }
@@ -36,7 +36,7 @@ public void Should_throw_when_ttl_strategy_is_null()
3636 public void Should_throw_when_cache_key_strategy_is_null ( )
3737 {
3838 IAsyncCacheProvider cacheProvider = new StubCacheProvider ( ) ;
39- Func < Context , string > cacheKeyStrategy = null ;
39+ Func < Context , string > ? cacheKeyStrategy = null ;
4040 Action action = ( ) => Policy . CacheAsync ( cacheProvider , TimeSpan . MaxValue , cacheKeyStrategy ) ;
4141 action . Should ( ) . Throw < ArgumentNullException > ( ) . And . ParamName . Should ( ) . Be ( "cacheKeyStrategy" ) ;
4242 }
@@ -234,7 +234,7 @@ public async Task Should_allow_custom_ICacheKeyStrategy()
234234 [ Fact ]
235235 public async Task Should_execute_delegate_and_put_value_in_cache_if_cache_does_not_hold_value__default_for_reference_type ( )
236236 {
237- ResultClass valueToReturn = default ;
237+ ResultClass ? valueToReturn = null ;
238238 const string operationKey = "SomeOperationKey" ;
239239
240240 IAsyncCacheProvider stubCacheProvider = new StubCacheProvider ( ) ;
@@ -254,7 +254,7 @@ public async Task Should_execute_delegate_and_put_value_in_cache_if_cache_does_n
254254 [ Fact ]
255255 public async Task Should_return_value_from_cache_and_not_execute_delegate_if_cache_holds_value__default_for_reference_type ( )
256256 {
257- ResultClass valueToReturnFromCache = default ;
257+ ResultClass ? valueToReturnFromCache = null ;
258258 ResultClass valueToReturnFromExecution = new ResultClass ( ResultPrimitive . Good ) ;
259259 const string operationKey = "SomeOperationKey" ;
260260
@@ -517,7 +517,7 @@ public async Task Should_call_onError_delegate_if_cache_get_errors()
517517 Exception ex = new Exception ( ) ;
518518 IAsyncCacheProvider stubCacheProvider = new StubErroringCacheProvider ( getException : ex , putException : null ) ;
519519
520- Exception exceptionFromCacheProvider = null ;
520+ Exception ? exceptionFromCacheProvider = null ;
521521
522522 const string valueToReturnFromCache = "valueToReturnFromCache" ;
523523 const string valueToReturnFromExecution = "valueToReturnFromExecution" ;
@@ -553,7 +553,7 @@ public async Task Should_call_onError_delegate_if_cache_put_errors()
553553 Exception ex = new Exception ( ) ;
554554 IAsyncCacheProvider stubCacheProvider = new StubErroringCacheProvider ( getException : null , putException : ex ) ;
555555
556- Exception exceptionFromCacheProvider = null ;
556+ Exception ? exceptionFromCacheProvider = null ;
557557
558558 const string valueToReturn = "valueToReturn" ;
559559 const string operationKey = "SomeOperationKey" ;
@@ -584,10 +584,10 @@ public async Task Should_execute_oncacheget_after_got_from_cache()
584584 const string valueToReturnFromExecution = "valueToReturnFromExecution" ;
585585
586586 const string operationKey = "SomeOperationKey" ;
587- string keyPassedToDelegate = null ;
587+ string ? keyPassedToDelegate = null ;
588588
589589 Context contextToExecute = new Context ( operationKey ) ;
590- Context contextPassedToDelegate = null ;
590+ Context ? contextPassedToDelegate = null ;
591591
592592 Action < Context , string , Exception > noErrorHandling = ( _ , _ , _ ) => { } ;
593593 Action < Context , string > emptyDelegate = ( _ , _ ) => { } ;
@@ -617,12 +617,12 @@ public async Task Should_execute_oncachemiss_and_oncacheput_if_cache_does_not_ho
617617 const string valueToReturn = "valueToReturn" ;
618618
619619 const string operationKey = "SomeOperationKey" ;
620- string keyPassedToOnCacheMiss = null ;
621- string keyPassedToOnCachePut = null ;
620+ string ? keyPassedToOnCacheMiss = null ;
621+ string ? keyPassedToOnCachePut = null ;
622622
623623 Context contextToExecute = new Context ( operationKey ) ;
624- Context contextPassedToOnCacheMiss = null ;
625- Context contextPassedToOnCachePut = null ;
624+ Context ? contextPassedToOnCacheMiss = null ;
625+ Context ? contextPassedToOnCachePut = null ;
626626
627627 Action < Context , string , Exception > noErrorHandling = ( _ , _ , _ ) => { } ;
628628 Action < Context , string > emptyDelegate = ( _ , _ ) => { } ;
@@ -654,12 +654,12 @@ public async Task Should_execute_oncachemiss_but_not_oncacheput_if_cache_does_no
654654 const string valueToReturn = "valueToReturn" ;
655655
656656 const string operationKey = "SomeOperationKey" ;
657- string keyPassedToOnCacheMiss = null ;
658- string keyPassedToOnCachePut = null ;
657+ string ? keyPassedToOnCacheMiss = null ;
658+ string ? keyPassedToOnCachePut = null ;
659659
660660 Context contextToExecute = new Context ( operationKey ) ;
661- Context contextPassedToOnCacheMiss = null ;
662- Context contextPassedToOnCachePut = null ;
661+ Context ? contextPassedToOnCacheMiss = null ;
662+ Context ? contextPassedToOnCachePut = null ;
663663
664664 Action < Context , string , Exception > noErrorHandling = ( _ , _ , _ ) => { } ;
665665 Action < Context , string > emptyDelegate = ( _ , _ ) => { } ;
0 commit comments