コード例 #1
0
        public void DownloadGzippedFile_NoClientDecompression()
        {
            var service = new StorageService(new BaseClientService.Initializer
            {
                HttpClientInitializer = _fixture.Client.Service.HttpClientInitializer,
                GZipEnabled           = false
            });
            var client = new StorageClientImpl(service);
            var stream = new MemoryStream();

            client.DownloadObject(StorageFixture.CrossLanguageTestBucket, "gzipped-text.txt", stream);
            var expected = Encoding.UTF8.GetBytes("hello world");
            var actual   = stream.ToArray();

            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void DownloadGzippedFile_NoClientDecompression_IgnoreHash()
        {
            TestEnvironment.SkipIfVpcSc();

            var service = new StorageService(new BaseClientService.Initializer
            {
                HttpClientInitializer = _fixture.Client.Service.HttpClientInitializer,
                GZipEnabled           = false
            });
            var client = new StorageClientImpl(service);
            var stream = new MemoryStream();

            client.DownloadObject(StorageFixture.CrossLanguageTestBucket, "gzipped-text.txt", stream,
                                  new DownloadObjectOptions {
                DownloadValidationMode = DownloadValidationMode.Never
            });
            var expected = Encoding.UTF8.GetBytes("hello world");
            var actual   = stream.ToArray();

            Assert.Equal(expected, actual);
        }