Ejemplo n.º 1
0
        public void ProvidesProperContentType(string folderName, string expectedContentType)
        {
            var target = new GalleryCloudBlobContainerInformationProvider();

            var contentType = target.GetContentType(folderName);

            Assert.Equal(expectedContentType, contentType);
        }
Ejemplo n.º 2
0
        public void ProvidesProperCacheControl(string folderName)
        {
            var target = new GalleryCloudBlobContainerInformationProvider();

            var cacheControl = target.GetCacheControl(folderName);

            if (folderName == CoreConstants.Folders.PackagesFolderName ||
                folderName == CoreConstants.Folders.SymbolPackagesFolderName ||
                folderName == CoreConstants.Folders.ValidationFolderName)
            {
                Assert.Equal(CoreConstants.DefaultCacheControl, cacheControl);
            }
            else
            {
                Assert.Null(cacheControl);
            }
        }
Ejemplo n.º 3
0
        public CloudBlobCoreFileStorageServiceIntegrationTests(BlobStorageFixture fixture, ITestOutputHelper output)
        {
            _fixture = fixture ?? throw new ArgumentNullException(nameof(fixture));
            _output  = output ?? throw new ArgumentNullException(nameof(output));
            _testId  = Guid.NewGuid().ToString();
            _prefixA = $"{_fixture.PrefixA}/{_testId}";
            _prefixB = $"{_fixture.PrefixB}/{_testId}";

            _clientA = new CloudBlobClientWrapper(_fixture.ConnectionStringA, readAccessGeoRedundant: false);
            _clientB = new CloudBlobClientWrapper(_fixture.ConnectionStringB, readAccessGeoRedundant: false);

            _blobClientA = CloudStorageAccount.Parse(_fixture.ConnectionStringA).CreateCloudBlobClient();
            _blobClientB = CloudStorageAccount.Parse(_fixture.ConnectionStringB).CreateCloudBlobClient();

            var folderInformationProvider = new GalleryCloudBlobContainerInformationProvider();

            _targetA = new CloudBlobCoreFileStorageService(_clientA, Mock.Of <IDiagnosticsService>(), folderInformationProvider);
            _targetB = new CloudBlobCoreFileStorageService(_clientB, Mock.Of <IDiagnosticsService>(), folderInformationProvider);
        }