Exemplo n.º 1
0
        public void TestExpireAfterWriteSet()
        {
            CacheBuilder <int, string> cacheBuilder = CacheBuilder <int, string> .NewBuilder();

            TimeSpan expireAfterWriteSeconds = TimeSpan.FromSeconds(ThreadLocalRandom.Current.Next());

            cacheBuilder.WithExpireAfterAccess(expireAfterWriteSeconds);
            Assert.AreEqual((long)Math.Round(expireAfterWriteSeconds.TotalMilliseconds),
                            cacheBuilder.ExpireAfterAccessMilliseconds);
        }