Skip to content

Commit

Permalink
fix: 修正測試案例的 key
Browse files Browse the repository at this point in the history
  • Loading branch information
yaochangyu committed Nov 3, 2024
1 parent c97e6d6 commit 10bb23b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Cache/Lab.Cache/Lab.Cache.Test/CacheProviderFactoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions Cache/Lab.Cache/Lab.Cache.Test/DistributeCacheTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task 寫讀快取資料_Json()
var cache = serviceProvider.GetService<IDistributedCache>();
var options = serviceProvider.GetService<DistributedCacheEntryOptions>();

var key = "Cache:Member:1";
var key = $"{nameof(DistributeCacheTest)}:Member:1";
var expected = JsonSerializer.Serialize(new { Name = "小心肝" });
await cache.SetStringAsync(key, expected, options);

Expand All @@ -59,7 +59,7 @@ public async Task 寫讀快取資料_String()
var cache = serviceProvider.GetService<IDistributedCache>();
var options = serviceProvider.GetService<DistributedCacheEntryOptions>();

var key = "Cache:Member:2";
var key = $"{nameof(DistributeCacheTest)}:Member:2";
var expected = "小心肝";
await cache.SetStringAsync(key, expected, options);

Expand Down
4 changes: 2 additions & 2 deletions Cache/Lab.Cache/Lab.Cache.Test/MemoryCacheTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public async Task 寫讀快取資料_Json_Memory()
var cache = serviceProvider.GetService<IMemoryCache>();
var options = serviceProvider.GetService<MemoryCacheEntryOptions>();

var key = "Cache:Member:1";
var key = $"{nameof(MemoryCacheTest)}:Member:1";
var expected = JsonSerializer.Serialize(new { Name = "小心肝" });
cache.Set(key, expected, options);

Expand All @@ -53,7 +53,7 @@ public async Task 寫讀快取資料_String_Memory()
var cache = serviceProvider.GetService<IMemoryCache>();
var options = serviceProvider.GetService<MemoryCacheEntryOptions>();

var key = "Cache:Member:2";
var key = $"{nameof(MemoryCacheTest)}:Member:2";
var expected = "小心肝";
cache.Set(key, expected, options);

Expand Down

0 comments on commit 10bb23b

Please sign in to comment.