@@ -51,6 +51,9 @@ public void Configuration_CacheManager_ComplexSingleManager()
5151 config . CacheHandleConfigurations [ 1 ] . Key . Should ( ) . Be ( key + "2" ) ;
5252 config . CacheHandleConfigurations [ 0 ] . Name . Should ( ) . Be ( "handleName" ) ;
5353 config . CacheHandleConfigurations [ 1 ] . Name . Should ( ) . Be ( "handleName2" ) ;
54+
55+ var cache = new BaseCacheManager < string > ( config ) ;
56+ cache . Add ( "key" , "value" ) . Should ( ) . BeTrue ( ) ;
5457 }
5558
5659 [ Fact ]
@@ -80,13 +83,16 @@ public void Configuration_CacheManager_ComplexManyManager()
8083 } ;
8184
8285 var configs = GetConfiguration ( data ) . GetCacheConfigurations ( ) . ToArray ( ) ;
83- for ( var i = 1 ; i <= configs . Count ( ) ; i ++ )
86+ for ( var i = 1 ; i <= configs . Count ( ) ; i ++ )
8487 {
8588 var config = configs [ i - 1 ] ;
86- config . Name . Should ( ) . Be ( "myCacheName" + i ) ;
89+ config . Name . Should ( ) . Be ( "myCacheName" + i ) ;
8790 config . MaxRetries . Should ( ) . Be ( i * 100 ) ;
8891 config . RetryTimeout . Should ( ) . Be ( i * 100 ) ;
8992 config . CacheHandleConfigurations . Count . Should ( ) . Be ( i ) ;
93+
94+ var cache = new BaseCacheManager < string > ( config ) ;
95+ cache . Add ( "key" , "value" ) . Should ( ) . BeTrue ( ) ;
9096 }
9197 }
9298
@@ -121,6 +127,9 @@ public void Configuration_CacheManager_ByNameFromMany()
121127 config . MaxRetries . Should ( ) . Be ( 200 ) ;
122128 config . RetryTimeout . Should ( ) . Be ( 200 ) ;
123129 config . CacheHandleConfigurations . Count . Should ( ) . Be ( 2 ) ;
130+
131+ var cache = new BaseCacheManager < string > ( config ) ;
132+ cache . Add ( "key" , "value" ) . Should ( ) . BeTrue ( ) ;
124133 }
125134
126135 [ Fact ]
@@ -191,6 +200,8 @@ public void Configuration_CacheManager_AllProperties()
191200 config . MaxRetries . Should ( ) . Be ( 42 ) ;
192201 config . RetryTimeout . Should ( ) . Be ( 21 ) ;
193202 config . UpdateMode . Should ( ) . Be ( CacheUpdateMode . Up ) ;
203+ var cache = new BaseCacheManager < string > ( config ) ;
204+ cache . Add ( "key" , "value" ) . Should ( ) . BeTrue ( ) ;
194205 }
195206
196207 [ Fact ]
@@ -296,6 +307,7 @@ public void Configuration_CacheHandle_MinimalValid()
296307 }
297308
298309#if ! NETCOREAPP
310+
299311 [ Fact ]
300312 public void Configuration_CacheHandle_KnownType_SystemRuntime ( )
301313 {
@@ -309,7 +321,10 @@ public void Configuration_CacheHandle_KnownType_SystemRuntime()
309321 config . Name . Should ( ) . Be ( "name" ) ;
310322 config . CacheHandleConfigurations . Count . Should ( ) . Be ( 1 ) ;
311323 config . CacheHandleConfigurations [ 0 ] . HandleType . Should ( ) . Be ( typeof ( SystemRuntimeCaching . MemoryCacheHandle < > ) ) ;
324+ var cache = new BaseCacheManager < string > ( config ) ;
325+ cache . Add ( "key" , "value" ) . Should ( ) . BeTrue ( ) ;
312326 }
327+
313328#endif
314329
315330 [ Fact ]
@@ -364,6 +379,7 @@ public void Configuration_CacheHandle_KnownType_RedisB()
364379 }
365380
366381#if ! NETCOREAPP
382+
367383 [ Fact ]
368384 public void Configuration_CacheHandle_KnownType_CouchbaseNoKey ( )
369385 {
@@ -429,10 +445,13 @@ public void Configuration_CacheHandle_KnownType_MemcachedNoKey()
429445 action . ShouldThrow < InvalidOperationException > ( ) . WithMessage ( "*'key' or 'name'*" ) ;
430446 }
431447
448+ #if MEMCACHEDENABLED
449+
432450 [ Fact ]
451+ [ Trait ( "category" , "memcached" ) ]
433452 public void Configuration_CacheHandle_KnownType_Memcached ( )
434453 {
435- var key = Guid . NewGuid ( ) . ToString ( ) ;
454+ var key = "default" ;
436455 var data = new Dictionary < string , string >
437456 {
438457 { "cacheManagers:0:name" , "name" } ,
@@ -446,8 +465,13 @@ public void Configuration_CacheHandle_KnownType_Memcached()
446465 config . CacheHandleConfigurations [ 0 ] . HandleType . Should ( ) . Be ( typeof ( Memcached . MemcachedCacheHandle < > ) ) ;
447466 config . CacheHandleConfigurations [ 0 ] . Key . Should ( ) . Be ( key ) ;
448467 config . CacheHandleConfigurations [ 0 ] . Name . Should ( ) . NotBeNullOrWhiteSpace ( ) ; // name is random in this case
468+
469+ var cache = new BaseCacheManager < string > ( config ) ;
470+ cache . Add ( Guid . NewGuid ( ) . ToString ( ) , "value" ) . Should ( ) . BeTrue ( ) ;
449471 }
450472
473+ #endif
474+
451475 [ Fact ]
452476 public void Configuration_CacheHandle_KnownType_MemcachedB ( )
453477 {
@@ -465,7 +489,7 @@ public void Configuration_CacheHandle_KnownType_MemcachedB()
465489 config . CacheHandleConfigurations [ 0 ] . Name . Should ( ) . Be ( "name" ) ;
466490 config . CacheHandleConfigurations [ 0 ] . Key . Should ( ) . Be ( "name" ) ; // now key gets set to name
467491 }
468-
492+
469493 [ Fact ]
470494 public void Configuration_CacheHandle_Type_MemcachedB ( )
471495 {
@@ -498,6 +522,7 @@ public void Configuration_CacheHandle_KnownType_Web()
498522 config . CacheHandleConfigurations . Count . Should ( ) . Be ( 1 ) ;
499523 config . CacheHandleConfigurations [ 0 ] . HandleType . Should ( ) . Be ( typeof ( Web . SystemWebCacheHandle < > ) ) ;
500524 }
525+
501526#endif
502527
503528 [ Fact ]
@@ -513,8 +538,10 @@ public void Configuration_CacheHandle_KnownType_Dictionary()
513538 config . Name . Should ( ) . Be ( "name" ) ;
514539 config . CacheHandleConfigurations . Count . Should ( ) . Be ( 1 ) ;
515540 config . CacheHandleConfigurations [ 0 ] . HandleType . Should ( ) . Be ( typeof ( Core . Internal . DictionaryCacheHandle < > ) ) ;
516- }
517541
542+ var cache = new BaseCacheManager < string > ( config ) ;
543+ cache . Add ( "key" , "value" ) . Should ( ) . BeTrue ( ) ;
544+ }
518545
519546 [ Fact ]
520547 public void Configuration_CacheHandle_KnownType_MsMemory ( )
@@ -529,6 +556,9 @@ public void Configuration_CacheHandle_KnownType_MsMemory()
529556 config . Name . Should ( ) . Be ( "name" ) ;
530557 config . CacheHandleConfigurations . Count . Should ( ) . Be ( 1 ) ;
531558 config . CacheHandleConfigurations [ 0 ] . HandleType . Should ( ) . Be ( typeof ( CacheManager . MicrosoftCachingMemory . MemoryCacheHandle < > ) ) ;
559+
560+ var cache = new BaseCacheManager < string > ( config ) ;
561+ cache . Add ( "key" , "value" ) . Should ( ) . BeTrue ( ) ;
532562 }
533563
534564 [ Fact ]
@@ -557,6 +587,9 @@ public void Configuration_CacheHandle_AllProperties()
557587 config . CacheHandleConfigurations [ 0 ] . IsBackplaneSource . Should ( ) . BeTrue ( ) ;
558588 config . CacheHandleConfigurations [ 0 ] . Name . Should ( ) . Be ( "handleName" ) ;
559589 config . CacheHandleConfigurations [ 0 ] . Key . Should ( ) . Be ( key ) ;
590+
591+ var cache = new BaseCacheManager < string > ( config ) ;
592+ cache . Add ( "key" , "value" ) . Should ( ) . BeTrue ( ) ;
560593 }
561594
562595 [ Fact ]
@@ -704,7 +737,7 @@ public void Configuration_Backplane_InvalidKnownTypeB()
704737 Action act = ( ) => GetConfiguration ( data ) . GetCacheConfiguration ( "name" ) ;
705738 act . ShouldThrow < InvalidOperationException > ( ) . WithMessage ( "*Known backplane type 'Something' is invalid*" ) ;
706739 }
707-
740+
708741 [ Fact ]
709742 public void Configuration_Backplane_Redis_MissingKey ( )
710743 {
@@ -719,7 +752,11 @@ public void Configuration_Backplane_Redis_MissingKey()
719752 act . ShouldThrow < InvalidOperationException > ( ) . WithMessage ( "*The key property is required*" ) ;
720753 }
721754
755+ #if REDISENABLED
756+
722757 [ Fact ]
758+ [ Trait ( "category" , "Redis" ) ]
759+ [ Trait ( "category" , "Unreliable" ) ]
723760 public void Configuration_Backplane_Redis_Valid ( )
724761 {
725762 var key = Guid . NewGuid ( ) . ToString ( ) ;
@@ -742,8 +779,13 @@ public void Configuration_Backplane_Redis_Valid()
742779 config . BackplaneConfigurationKey . Should ( ) . Be ( key ) ;
743780 config . BackplaneType . Should ( ) . Be ( typeof ( Redis . RedisCacheBackplane ) ) ;
744781 config . HasBackplane . Should ( ) . BeTrue ( ) ;
782+
783+ var cache = new BaseCacheManager < string > ( config ) ;
784+ cache . Add ( Guid . NewGuid ( ) . ToString ( ) , "value" ) . Should ( ) . BeTrue ( ) ;
745785 }
746786
787+ #endif
788+
747789 [ Fact ]
748790 public void Configuration_Backplane_SomeType_Valid ( )
749791 {
@@ -834,6 +876,9 @@ public void Configuration_LoggerFactory_KnownType_Valid()
834876
835877 var config = GetConfiguration ( data ) . GetCacheConfiguration ( "name" ) ;
836878 config . LoggerFactoryType . Should ( ) . Be ( typeof ( Logging . MicrosoftLoggerFactoryAdapter ) ) ;
879+
880+ var cache = new BaseCacheManager < string > ( config ) ;
881+ cache . Add ( "key" , "value" ) . Should ( ) . BeTrue ( ) ;
837882 }
838883
839884 [ Fact ]
@@ -901,6 +946,7 @@ public void Configuration_Serializer_SomeType_Valid()
901946 }
902947
903948#if ! NETCOREAPP
949+
904950 [ Fact ]
905951 public void Configuration_Serializer_KnownType_Binary ( )
906952 {
@@ -921,6 +967,7 @@ public void Configuration_Serializer_KnownType_Binary()
921967 config . SerializerType . Should ( ) . Be ( typeof ( Core . Internal . BinaryCacheSerializer ) ) ;
922968 act . ShouldNotThrow ( ) ;
923969 }
970+
924971#endif
925972
926973 [ Fact ]
@@ -1024,7 +1071,7 @@ public void Configuration_Serializer_KnownType_BondCompact()
10241071 cache . Add ( "key" , "value" ) ;
10251072 } ;
10261073
1027- config . SerializerType . Should ( ) . Be ( typeof ( Serialization . Bond . BondCompactBinaryCacheSerializer ) ) ;
1074+ config . SerializerType . Should ( ) . Be ( typeof ( Serialization . Bond . BondCompactBinaryCacheSerializer ) ) ;
10281075 act . ShouldNotThrow ( ) ;
10291076 }
10301077
@@ -1049,7 +1096,6 @@ public void Configuration_Serializer_KnownType_BondFast()
10491096 act . ShouldNotThrow ( ) ;
10501097 }
10511098
1052-
10531099 [ Fact ]
10541100 public void Configuration_Serializer_KnownType_BondJosn ( )
10551101 {
@@ -1168,7 +1214,7 @@ public void Configuration_Redis_Invalid_IsSsl()
11681214 Action act = ( ) => GetConfiguration ( data ) . LoadRedisConfigurations ( ) ;
11691215 act . ShouldThrow < InvalidOperationException > ( ) . WithMessage ( "*Failed to convert 'invalid'*" ) ;
11701216 }
1171-
1217+
11721218 [ Fact ]
11731219 public void Configuration_Redis_Properties ( )
11741220 {
0 commit comments