Esempio n. 1
0
        public async void GivenMultipleCollections_WhenInitializing_ThenEachContainerInitializeMethodIsCalled()
        {
            await _blobClientInitializer.InitializeDataStoreAsync(_blobClient, _blobDataStoreConfiguration, _collectionInitializers);

            await _containerInitializer1.Received(1).InitializeContainerAsync(_blobClient);

            await _containerInitializer2.Received(1).InitializeContainerAsync(_blobClient);
        }
        public BlobClientProvider(
            BlobDataStoreConfiguration blobDataStoreConfiguration,
            IBlobClientInitializer blobClientInitializer,
            ILogger <BlobClientProvider> logger,
            IEnumerable <IBlobContainerInitializer> collectionInitializers)
        {
            EnsureArg.IsNotNull(blobDataStoreConfiguration, nameof(blobDataStoreConfiguration));
            EnsureArg.IsNotNull(blobClientInitializer, nameof(blobClientInitializer));
            EnsureArg.IsNotNull(logger, nameof(logger));
            EnsureArg.IsNotNull(collectionInitializers, nameof(collectionInitializers));

            _blobServiceClient = blobClientInitializer.CreateBlobClient(blobDataStoreConfiguration);

            _initializationOperation = new RetryableInitializationOperation(
                () => blobClientInitializer.InitializeDataStoreAsync(_blobServiceClient, blobDataStoreConfiguration, collectionInitializers));
        }