From 10bb23be46c41ceef210e6eea4fde67240eea14c Mon Sep 17 00:00:00 2001 From: yao Date: Sun, 3 Nov 2024 22:58:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=B8=AC=E8=A9=A6?= =?UTF-8?q?=E6=A1=88=E4=BE=8B=E7=9A=84=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Lab.Cache/Lab.Cache.Test/CacheProviderFactoryTest.cs | 8 ++++---- Cache/Lab.Cache/Lab.Cache.Test/DistributeCacheTest.cs | 4 ++-- Cache/Lab.Cache/Lab.Cache.Test/MemoryCacheTest.cs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cache/Lab.Cache/Lab.Cache.Test/CacheProviderFactoryTest.cs b/Cache/Lab.Cache/Lab.Cache.Test/CacheProviderFactoryTest.cs index 31350396..ddd398bd 100644 --- a/Cache/Lab.Cache/Lab.Cache.Test/CacheProviderFactoryTest.cs +++ b/Cache/Lab.Cache/Lab.Cache.Test/CacheProviderFactoryTest.cs @@ -29,7 +29,7 @@ public async Task 寫讀快取資料_Json_Redis() var cacheProviderFactory = CreateCacheProviderFactory(); var cacheProvider = cacheProviderFactory.Create(CacheProviderType.Redis); - var key = "Cache:Member:1"; + var key = "CacheProviderFactoryTest:Member:1"; var expected = JsonSerializer.Serialize(new { Name = "小心肝" }); await cacheProvider.SetAsync(key, expected); @@ -43,7 +43,7 @@ public async Task 寫讀快取資料_String_Redis() var cacheProviderFactory = CreateCacheProviderFactory(); var cacheProvider = cacheProviderFactory.Create(CacheProviderType.Redis); - var key = "Cache:Member:2"; + var key = "CacheProviderFactoryTest:Member:2"; var expected = "小心肝"; await cacheProvider.SetAsync(key, expected); @@ -57,7 +57,7 @@ public async Task 寫讀快取資料_Json_Memory() var cacheProviderFactory = CreateCacheProviderFactory(); var cacheProvider = cacheProviderFactory.Create(CacheProviderType.Memory); - var key = "Cache:Member:1"; + var key = "CacheProviderFactoryTest:Member:1"; var expected = JsonSerializer.Serialize(new { Name = "小心肝" }); await cacheProvider.SetAsync(key, expected); @@ -71,7 +71,7 @@ public async Task 寫讀快取資料_String_Memory() var cacheProviderFactory = CreateCacheProviderFactory(); var cacheProvider = cacheProviderFactory.Create(CacheProviderType.Memory); - var key = "Cache:Member:2"; + var key = "CacheProviderFactoryTest:Member:2"; var expected = "小心肝"; await cacheProvider.SetAsync(key, expected); diff --git a/Cache/Lab.Cache/Lab.Cache.Test/DistributeCacheTest.cs b/Cache/Lab.Cache/Lab.Cache.Test/DistributeCacheTest.cs index 1afc459b..0c195d85 100644 --- a/Cache/Lab.Cache/Lab.Cache.Test/DistributeCacheTest.cs +++ b/Cache/Lab.Cache/Lab.Cache.Test/DistributeCacheTest.cs @@ -44,7 +44,7 @@ public async Task 寫讀快取資料_Json() var cache = serviceProvider.GetService(); var options = serviceProvider.GetService(); - var key = "Cache:Member:1"; + var key = $"{nameof(DistributeCacheTest)}:Member:1"; var expected = JsonSerializer.Serialize(new { Name = "小心肝" }); await cache.SetStringAsync(key, expected, options); @@ -59,7 +59,7 @@ public async Task 寫讀快取資料_String() var cache = serviceProvider.GetService(); var options = serviceProvider.GetService(); - var key = "Cache:Member:2"; + var key = $"{nameof(DistributeCacheTest)}:Member:2"; var expected = "小心肝"; await cache.SetStringAsync(key, expected, options); diff --git a/Cache/Lab.Cache/Lab.Cache.Test/MemoryCacheTest.cs b/Cache/Lab.Cache/Lab.Cache.Test/MemoryCacheTest.cs index d70f456a..a2e33658 100644 --- a/Cache/Lab.Cache/Lab.Cache.Test/MemoryCacheTest.cs +++ b/Cache/Lab.Cache/Lab.Cache.Test/MemoryCacheTest.cs @@ -38,7 +38,7 @@ public async Task 寫讀快取資料_Json_Memory() var cache = serviceProvider.GetService(); var options = serviceProvider.GetService(); - var key = "Cache:Member:1"; + var key = $"{nameof(MemoryCacheTest)}:Member:1"; var expected = JsonSerializer.Serialize(new { Name = "小心肝" }); cache.Set(key, expected, options); @@ -53,7 +53,7 @@ public async Task 寫讀快取資料_String_Memory() var cache = serviceProvider.GetService(); var options = serviceProvider.GetService(); - var key = "Cache:Member:2"; + var key = $"{nameof(MemoryCacheTest)}:Member:2"; var expected = "小心肝"; cache.Set(key, expected, options);