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()
111
111
GetAssertPass ( getResult , expectedValue ) ;
112
112
}
113
113
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 . GetValueAsync < string > ( key ) ;
121
+ Assert . Equal ( getResult , empty ) ;
122
+ }
123
+
114
124
[ Fact ]
115
125
public async Task GetValueOrCreateAsyncTest ( )
116
126
{
@@ -132,7 +142,7 @@ private Task<IEnumerable<BlogPost>> GenerateValue()
132
142
var posts = new List < BlogPost > ( )
133
143
{
134
144
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" } ,
136
146
} ;
137
147
138
148
return Task . FromResult ( posts . AsEnumerable ( ) ) ;
Original file line number Diff line number Diff line change @@ -30,8 +30,6 @@ object ITranscoder.Deserialize(CacheItem item)
30
30
31
31
public virtual T Deserialize < T > ( CacheItem item )
32
32
{
33
- if ( item . Data == null || item . Data . Count == 0 ) return default ( T ) ;
34
-
35
33
if ( typeof ( T ) . GetTypeCode ( ) != TypeCode . Object || typeof ( T ) == typeof ( Byte [ ] ) )
36
34
{
37
35
var value = Deserialize ( item ) ;
You can’t perform that action at this time.
0 commit comments