public void Returns_EmptyTemplateCacheResult_OnNonExistingTemplate() { var cache = new MemoryCachingProvider(); var templateResult = cache.RetrieveTemplate("someKey"); Assert.NotNull(templateResult); Assert.Null(templateResult.Template.TemplatePageFactory); Assert.False(templateResult.Success); }
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); }
public void Throws_OnNullTemplateKey_WhenRetrieve() { var cache = new MemoryCachingProvider(); Assert.Throws <ArgumentNullException>(() => cache.RetrieveTemplate(null)); }