File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Enyim.Caching/Memcached/Transcoders Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,16 @@ public void When_Getting_SByte_Result_Is_Successful()
111111 GetAssertPass ( getResult , expectedValue ) ;
112112 }
113113
114+ [ Fact ]
115+ public async Task When_Getting_Empty_String_Async_Result_Is_Successful ( )
116+ {
117+ var key = GetUniqueKey ( "Get" ) ;
118+ var empty = string . Empty ;
119+ Store ( key : key , value : empty ) ;
120+ var getResult = await _client . GetAsync < string > ( key ) ;
121+ Assert . Equal ( getResult . Value , empty ) ;
122+ }
123+
114124 [ Fact ]
115125 public async Task GetValueOrCreateAsyncTest ( )
116126 {
@@ -132,7 +142,7 @@ private Task<IEnumerable<BlogPost>> GenerateValue()
132142 var posts = new List < BlogPost > ( )
133143 {
134144 new BlogPost { Title = "test title 1" , Body = "test body 1" } ,
135- new BlogPost { Title = "test title 2" , Body = "test body 2" }
145+ new BlogPost { Title = "test title 2" , Body = "test body 2" } ,
136146 } ;
137147
138148 return Task . FromResult ( posts . AsEnumerable ( ) ) ;
Original file line number Diff line number Diff line change @@ -30,8 +30,6 @@ object ITranscoder.Deserialize(CacheItem item)
3030
3131 public virtual T Deserialize < T > ( CacheItem item )
3232 {
33- if ( item . Data == null || item . Data . Count == 0 ) return default ( T ) ;
34-
3533 if ( typeof ( T ) . GetTypeCode ( ) != TypeCode . Object || typeof ( T ) == typeof ( Byte [ ] ) )
3634 {
3735 var value = Deserialize ( item ) ;
You can’t perform that action at this time.
0 commit comments