public static RetrieveBlobAndEtagFromServerCacheOrUri ( ICache cache, |
||
cache | ICache | |
uri | ||
return | object>.Dictionary |
public void RetrieveUncachedBlobYieldsBlob() { MockCache cache = new MockCache(); var direct_fetch = HttpUtils.FetchUrl(blob_uri).bytes; var indirect_fetch = CacheUtils.RetrieveBlobAndEtagFromServerCacheOrUri(cache, blob_uri)["response_body"]; Assert.AreEqual(indirect_fetch, direct_fetch); }
public void CacheWithBlobYieldsCachedBlob() { MockCache cache = new MockCache(); var cache_span = new TimeSpan(1, 0, 0); cache.Insert(blob_uri.ToString(), cached_blob_contents, null, Cache.NoAbsoluteExpiration, cache_span, CacheItemPriority.Normal, null); var indirect_fetch = CacheUtils.RetrieveBlobAndEtagFromServerCacheOrUri(cache, blob_uri); Assert.AreEqual(indirect_fetch["response_body"], cached_blob_contents); }