Beispiel #1
0
        public void Throws_WhenCachingWithEmptyParams()
        {
            var cache = new MemoryCachingProvider();

            Assert.Throws <ArgumentNullException>(() => cache.CacheTemplate("someKey", null));
            Assert.Throws <ArgumentNullException>(() => cache.CacheTemplate(null, GetTestFactory()));
        }
Beispiel #2
0
        public void Contains_ReturnsTrue_OnCachedTemplate()
        {
            var    cache       = new MemoryCachingProvider();
            string templateKey = "key";

            cache.CacheTemplate(templateKey, GetTestFactory(templateKey));

            Assert.True(cache.Contains(templateKey));
        }
Beispiel #3
0
        public void Ensure_TemplateIsStored()
        {
            var cache = new MemoryCachingProvider();

            string templateKey = "key";
            var    factory     = GetTestFactory(templateKey);

            cache.CacheTemplate(templateKey, factory);

            var cachedFactory = cache.RetrieveTemplate(templateKey);

            Assert.Equal(factory, cachedFactory.Template.TemplatePageFactory);
        }