Browse Source

Added new test for IDistributedCache.

pull/13358/head
Halil İbrahim Kalkan 4 years ago
parent
commit
6209127e6a
  1. 15
      framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_Tests.cs

15
framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_Tests.cs

@ -947,4 +947,19 @@ public class DistributedCache_Tests : AbpIntegratedTest<AbpCachingTestModule>
cacheValue[0].Value.ShouldBeNull();
cacheValue[1].Value.ShouldBeNull();
}
[Fact]
public async Task Should_Get_Same_Instance_When_Resolve_With_Or_Without_Key()
{
var cache1 = GetRequiredService<IDistributedCache<PersonCacheItem>>();
var cache2 = GetRequiredService<IDistributedCache<PersonCacheItem, string>>();
await cache1.SetAsync("john", new PersonCacheItem("John Doe"));
var item1 = await cache1.GetAsync("john");
item1.Name.ShouldBe("John Doe");
var item2 = await cache2.GetAsync("john");
item2.Name.ShouldBe("John Doe");
}
}

Loading…
Cancel
Save