Skip to content

Commit 8f2c764

Browse files
authored
Upgrade CSRedisCore version to 3.8.671 (#499)
* fix: Upgrade CSRedisCore version to 3.8.671 #496 * test: add Use_Redis6_ACL test
1 parent 2fd7fdc commit 8f2c764

File tree

2 files changed

+45
-19
lines changed

2 files changed

+45
-19
lines changed

src/EasyCaching.CSRedis/EasyCaching.CSRedis.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</ItemGroup>
3333

3434
<ItemGroup>
35-
<PackageReference Include="CSRedisCore" Version="3.6.9" />
35+
<PackageReference Include="CSRedisCore" Version="3.8.671" />
3636
</ItemGroup>
3737
<ItemGroup>
3838
<ProjectReference Include="..\EasyCaching.Core\EasyCaching.Core.csproj" />

test/EasyCaching.UnitTests/CachingTests/CSRedisCachingProviderTest.cs

+44-18
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,32 @@ protected override IEasyCachingProvider CreateCachingProvider(Action<BaseProvide
4141
return serviceProvider.GetService<IEasyCachingProvider>();
4242
}
4343

44+
/*[Fact]
45+
public async void Use_Redis6_ACL_Should_Succeed()
46+
{
47+
IServiceCollection services = new ServiceCollection();
48+
services.AddEasyCaching(x =>
49+
x.UseCSRedis(options =>
50+
{
51+
options.DBConfig = new CSRedisDBOptions
52+
{
53+
ConnectionStrings = new System.Collections.Generic.List<string>
54+
{
55+
"127.0.0.1:6388,user=user,password=userpwd,defaultDatabase=13,poolsize=10"
56+
}
57+
};
58+
}).UseCSRedisLock().WithJson(EasyCachingConstValue.DefaultCSRedisName));
59+
IServiceProvider serviceProvider = services.BuildServiceProvider();
60+
var provider = serviceProvider.GetService<IEasyCachingProvider>();
61+
var key = Guid.NewGuid().ToString();
62+
var value = "value";
63+
await provider.SetAsync(key, value, TimeSpan.FromSeconds(20));
64+
65+
var getValue = await provider.GetAsync<string>(key);
66+
67+
Assert.Equal(value, getValue?.Value);
68+
}*/
69+
4470
[Fact]
4571
public void GetDatabase_Should_Succeed()
4672
{
@@ -148,7 +174,7 @@ public CSRedisCachingProviderWithKeyPrefixTest()
148174
config.SerializerName = "json";
149175

150176
}, "WithKeyPrefix");
151-
177+
152178
x.WithJson("json");
153179
});
154180

@@ -194,7 +220,7 @@ public void RemoveByPrefixTest()
194220
Assert.False(val3.HasValue);
195221
Assert.False(val4.HasValue);
196222
}
197-
223+
198224
[Theory]
199225
[InlineData("WithKeyPrefix")]
200226
[InlineData("NotKeyPrefix")]
@@ -219,7 +245,7 @@ public void RemoveByKeyPatternTest(string provider)
219245
var val6 = WithKeyPrefix.Get<string>("sky:birds:bar");
220246
var val7 = WithKeyPrefix.Get<string>("sky:birds:test:bar");
221247
var val8 = WithKeyPrefix.Get<string>("akey");
222-
248+
223249
Assert.True(val1.HasValue);
224250
Assert.True(val2.HasValue);
225251
Assert.True(val3.HasValue);
@@ -231,15 +257,15 @@ public void RemoveByKeyPatternTest(string provider)
231257

232258
// contains
233259
WithKeyPrefix.RemoveByPattern("*:pots:*");
234-
260+
235261
// postfix
236262
WithKeyPrefix.RemoveByPattern("*foo");
237-
263+
238264
// prefix
239-
WithKeyPrefix.RemoveByPattern("sky*");
240-
265+
WithKeyPrefix.RemoveByPattern("sky*");
266+
241267
// exact
242-
WithKeyPrefix.RemoveByPattern("akey");
268+
WithKeyPrefix.RemoveByPattern("akey");
243269

244270
var val9 = WithKeyPrefix.Get<string>("garden:pots:flowers");
245271
var val10 = WithKeyPrefix.Get<string>("garden:pots:flowers:test");
@@ -249,7 +275,7 @@ public void RemoveByKeyPatternTest(string provider)
249275
var val14 = WithKeyPrefix.Get<string>("sky:birds:bar");
250276
var val15 = WithKeyPrefix.Get<string>("sky:birds:test:bar");
251277
var val16 = WithKeyPrefix.Get<string>("akey");
252-
278+
253279
Assert.False(val9.HasValue);
254280
Assert.False(val10.HasValue);
255281
Assert.True(val11.HasValue);
@@ -259,8 +285,8 @@ public void RemoveByKeyPatternTest(string provider)
259285
Assert.False(val15.HasValue);
260286
Assert.False(val16.HasValue);
261287
}
262-
263-
[Theory]
288+
289+
[Theory]
264290
[InlineData("WithKeyPrefix")]
265291
[InlineData("NotKeyPrefix")]
266292
public async Task RemoveByKeyPatternAsyncTest(string provider)
@@ -284,7 +310,7 @@ public async Task RemoveByKeyPatternAsyncTest(string provider)
284310
var val6 = WithKeyPrefix.Get<string>("sky:birds:bar");
285311
var val7 = WithKeyPrefix.Get<string>("sky:birds:test:bar");
286312
var val8 = WithKeyPrefix.Get<string>("akey");
287-
313+
288314
Assert.True(val1.HasValue);
289315
Assert.True(val2.HasValue);
290316
Assert.True(val3.HasValue);
@@ -296,15 +322,15 @@ public async Task RemoveByKeyPatternAsyncTest(string provider)
296322

297323
// contains
298324
await WithKeyPrefix.RemoveByPatternAsync("*:pots:*");
299-
325+
300326
// postfix
301327
await WithKeyPrefix.RemoveByPatternAsync("*foo");
302-
328+
303329
// prefix
304-
await WithKeyPrefix.RemoveByPatternAsync("sky*");
305-
330+
await WithKeyPrefix.RemoveByPatternAsync("sky*");
331+
306332
// exact
307-
await WithKeyPrefix.RemoveByPatternAsync("akey");
333+
await WithKeyPrefix.RemoveByPatternAsync("akey");
308334

309335
var val9 = WithKeyPrefix.Get<string>("garden:pots:flowers");
310336
var val10 = WithKeyPrefix.Get<string>("garden:pots:flowers:test");
@@ -314,7 +340,7 @@ public async Task RemoveByKeyPatternAsyncTest(string provider)
314340
var val14 = WithKeyPrefix.Get<string>("sky:birds:bar");
315341
var val15 = WithKeyPrefix.Get<string>("sky:birds:test:bar");
316342
var val16 = WithKeyPrefix.Get<string>("akey");
317-
343+
318344
Assert.False(val9.HasValue);
319345
Assert.False(val10.HasValue);
320346
Assert.True(val11.HasValue);

0 commit comments

Comments
 (0)