public void CacheItem_ReturnsIfDisplayTypeNotSetToCacheItem(ItemLevelCacheMode mode, bool shouldInvokeStorageProvider) { var contentItem = ContentItem.WithPart(new ItemLevelCachePart(), "Article", 42); contentItem.As <ItemLevelCachePart>().ItemLevelCacheSettings["Detail"] = new ItemLevelCacheSettings { Mode = mode }; mSut.CacheItem(contentItem, "Detail", new ItemLevelCacheItem("html")); mOutputCacheStorageProvider.Verify(p => p.GetCacheItem(It.IsAny <string>()), Times.Exactly(shouldInvokeStorageProvider ? 1 : 0)); mOutputCacheStorageProvider.Verify(p => p.Set(It.IsAny <string>(), It.IsAny <CacheItem>()), Times.Exactly(shouldInvokeStorageProvider ? 1 : 0)); }
public void MarkupShouldBeTokenized_ReturnsTrueDisplayTypeIsConfiguredAndRequired(ItemLevelCacheMode mode, bool expectedValue) { var contentItem = ContentItem.WithPart(new ItemLevelCachePart(), "Article"); contentItem.As <ItemLevelCachePart>().ItemLevelCacheSettings["Detail"] = new ItemLevelCacheSettings { Mode = mode }; Assert.AreEqual(expectedValue, mSut.MarkupShouldBeTokenized(contentItem, "Detail")); }