コード例 #1
0
        public void ShouldSetExpireInSeconds()
        {
            var expectedExpiresInSecond = 1;
            var attribute = new DecorateInMemoryCacheAttribute(expireInSeconds: expectedExpiresInSecond);

            Assert.Equal(expectedExpiresInSecond, attribute.ExpireInSeconds);
        }
コード例 #2
0
        public void ShouldSetCacheKeyProviderType()
        {
            var expectedCacheKeyProviderType = typeof(FooCacheKeyProvider);

            var attribute = new DecorateInMemoryCacheAttribute(cacheKeyProviderType: expectedCacheKeyProviderType);

            Assert.Equal(expectedCacheKeyProviderType, attribute.CacheKeyProviderType);
        }
コード例 #3
0
        public void ShouldSetDefaultValues()
        {
            var expectedExpiresInSecond      = default(double);
            var expectedCacheKeyProviderType = default(Type);

            var attribute = new DecorateInMemoryCacheAttribute();

            Assert.Equal(expectedExpiresInSecond, attribute.ExpireInSeconds);
            Assert.Equal(expectedCacheKeyProviderType, attribute.CacheKeyProviderType);
        }