示例#1
0
        public void cache_memary_create_change_monitor_test()
        {
            string key = DateTime.Now.Ticks.ToString(CultureInfo.InvariantCulture);

            string[] tags     = new[] { "a", "b" };
            var      cacheKey = new CacheKey(key, tags);

            cacheKey.Should().NotBeNull();

            var provider = new StaticCache();
            var monitor  = provider.CreateChangeMonitor(cacheKey);

            monitor.Should().NotBeNull();
            monitor.CacheKeys.Should().HaveCount(2);

            var    cacheTag = new CacheTag("a");
            string tagKey   = provider.GetTagKey(cacheTag);

            tagKey.Should().NotBeNullOrEmpty();

            monitor.CacheKeys.Should().Contain(tagKey);
        }