예제 #1
0
        public SterlingCacheContentTest()
        {
            primaryKey   = new PrimaryCacheKey("https://localhost/test", "POST");
            secondaryKey = TestHelper.CreateContentKey();
            entry        = new CacheEntry(primaryKey, new string[0]);
            response     = new HttpResponseMessage(HttpStatusCode.BadRequest)
            {
                Content = new StringContent("42")
            };

            response.Headers.CacheControl = new CacheControlHeaderValue()
            {
                MaxAge = TimeSpan.FromHours(1)
            };
            response.Content.Headers.ContentLanguage.Add("de");

            // We need to add this here, since the header will be added during reconstruction in any case
            // That is (hopefully) not a problem, however, since it does not contribute to the "content" as such.
            response.Content.Headers.ContentLength = 2;

            content = new CacheContent()
            {
                PrimaryKey = primaryKey,
                ContentKey = secondaryKey,
                Response   = response
            };
        }
        public SterlingCacheContentTest()
        {
            primaryKey = new PrimaryCacheKey("https://localhost/test", "POST");
            secondaryKey = TestHelper.CreateContentKey();
            entry = new CacheEntry(primaryKey, new string[0]);
            response = new HttpResponseMessage(HttpStatusCode.BadRequest)
            {
                Content = new StringContent("42")
            };

            response.Headers.CacheControl = new CacheControlHeaderValue() { MaxAge = TimeSpan.FromHours(1) };
            response.Content.Headers.ContentLanguage.Add("de");

            // We need to add this here, since the header will be added during reconstruction in any case
            // That is (hopefully) not a problem, however, since it does not contribute to the "content" as such. 
            response.Content.Headers.ContentLength = 2;

            content = new CacheContent()
            {
                PrimaryKey = primaryKey,
                ContentKey = secondaryKey,
                Response = response
            };
        }
예제 #3
0
 public Task <ICacheContent> GetContentAsync(PrimaryCacheKey primaryKey, CacheContentKey contentKey)
 {
     throw new NotImplementedException();
 }