Beispiel #1
0
        public void ContainsShouldNotRecordTime()
        {
            //when
            _cache.Contains("key1");

            //then
            AssertNoAccessTime(_cache.Statistics, CacheStatisticsKeys.LastWrite);
        }
Beispiel #2
0
        public void Contains_Miss()
        {
            // when
            _cache.Contains("key1");

            // then
            var ratio = _cache.Statistics.SafeGetValue <decimal?>(CacheStatisticsKeys.CacheHitRatio);

            Assert.That(ratio, Is.EqualTo(0m));
        }
        public void ContainsShouldRecordTime()
        {
            //when
            DateTimeOffset expectedTime = DateTimeOffset.Now;

            _cache.Contains("key1");

            //then
            Thread.Sleep(60);
            AssertAccessTime(_cache.Statistics, CacheStatisticsKeys.LastRead, expectedTime);
        }