Example #1
0
        public void Default_config_build_key_then_valid()
        {
            var config = new CacheConfig();
            var key1   = config.BuildCacheKey("r", "k");

            Assert.AreEqual(key1, "r-k");

            var key2 = config.BuildCacheKey(null, "k");

            Assert.AreEqual(key2, "k");

            var key3 = config.BuildCacheKey(String.Empty, "k");

            Assert.AreEqual(key3, "k");
        }
Example #2
0
        public void Custom_config_build_key_then_valid()
        {
            var config = new CacheConfig(pattern: "{key}:{region}");
            var key    = config.BuildCacheKey("r", "k");

            Assert.AreEqual(key, "k:r");
        }