コード例 #1
0
        public void DeleteCache_Removes_CacheDirectory()
        {
            //Arrange
            var sut = new IntegrationTestResponseCache();

            //Act
            sut.DeleteCache();

            //Assert
            Assert.False(Directory.Exists(sut.CacheLocation));
        }
コード例 #2
0
        public HttpCachingHandlerTestsFixture()
        {
            ResponseCache = new IntegrationTestResponseCache();

            var httpClient = new HttpClient(new HttpCachingHandler(ResponseCache, new IntegrationTestHandler()));

            var request1 = new HttpRequestMessage(HttpMethod.Get, "http://integration-testing/Test-Text-Document.txt");

            request1.Headers.CacheControl = new CacheControlHeaderValue {
                NoStore = false
            };

            httpClient.SendAsync(request1);

            var request2 = new HttpRequestMessage(HttpMethod.Get, "http://integration-testing/Test-JPEG-file.jpg");

            request2.Headers.CacheControl = new CacheControlHeaderValue {
                NoStore = false
            };

            httpClient.SendAsync(request2);
        }
コード例 #3
0
 public IntegrationTestResponseCacheTests()
 {
     _sut = new IntegrationTestResponseCache();
 }