public async Task InitializeAsync() { IOptionsMonitor <BlobContainerConfiguration> optionsMonitor = Substitute.For <IOptionsMonitor <BlobContainerConfiguration> >(); optionsMonitor.Get(BlobConstants.ContainerConfigurationName).Returns(_blobContainerConfiguration); optionsMonitor.Get(MetadataConstants.ContainerConfigurationName).Returns(_metadataContainerConfiguration); IBlobClientTestProvider testProvider = new BlobClientReadWriteTestProvider(RecyclableMemoryStreamManager); var blobClientInitializer = new BlobClientInitializer(testProvider, NullLogger <BlobClientInitializer> .Instance); _blobClient = blobClientInitializer.CreateBlobClient(_blobDataStoreConfiguration); var blobContainerInitializer = new BlobContainerInitializer(_blobContainerConfiguration.ContainerName, NullLogger <BlobContainerInitializer> .Instance); var metadataContainerInitializer = new BlobContainerInitializer(_metadataContainerConfiguration.ContainerName, NullLogger <BlobContainerInitializer> .Instance); await blobClientInitializer.InitializeDataStoreAsync( _blobClient, _blobDataStoreConfiguration, new List <IBlobContainerInitializer> { blobContainerInitializer, metadataContainerInitializer }); var jsonSerializer = new JsonSerializer(); jsonSerializer.Converters.Add(new JsonDicomConverter()); FileStore = new BlobFileStore(_blobClient, optionsMonitor, RecyclableMemoryStreamManager, Substitute.For <BlobDataStoreConfiguration>()); MetadataStore = new BlobMetadataStore(_blobClient, jsonSerializer, optionsMonitor, RecyclableMemoryStreamManager); }
public async Task InitializeAsync() { IOptionsMonitor <BlobContainerConfiguration> optionsMonitor = Substitute.For <IOptionsMonitor <BlobContainerConfiguration> >(); optionsMonitor.Get(Constants.BlobContainerConfigurationName).Returns(_blobContainerConfiguration); optionsMonitor.Get(Constants.MetadataContainerConfigurationName).Returns(_metadataContainerConfiguration); IBlobClientTestProvider testProvider = new BlobClientReadWriteTestProvider(RecyclableMemoryStreamManager, NullLogger <BlobClientReadWriteTestProvider> .Instance); _blobClient = BlobClientFactory.Create(_blobDataStoreConfiguration); var blobClientInitializer = new BlobInitializer(_blobClient, testProvider, NullLogger <BlobInitializer> .Instance); var blobContainerInitializer = new BlobContainerInitializer(_blobContainerConfiguration.ContainerName, NullLogger <BlobContainerInitializer> .Instance); var metadataContainerInitializer = new BlobContainerInitializer(_metadataContainerConfiguration.ContainerName, NullLogger <BlobContainerInitializer> .Instance); await blobClientInitializer.InitializeDataStoreAsync( new List <IBlobContainerInitializer> { blobContainerInitializer, metadataContainerInitializer }); FileStore = new BlobFileStore(_blobClient, optionsMonitor, Options.Create(Substitute.For <BlobOperationOptions>())); MetadataStore = new BlobMetadataStore(_blobClient, RecyclableMemoryStreamManager, optionsMonitor, Options.Create(AppSerializerOptions.Json)); }