RetrieveBlobAndEtagFromServerCacheOrUri() public static method

public static RetrieveBlobAndEtagFromServerCacheOrUri ( ICache cache, Uri uri ) : object>.Dictionary
cache ICache
uri System.Uri
return object>.Dictionary
Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }