Esempio n. 1
0
        public async Task InitializeAsync()
        {
            await _sqlDataStoreTestsFixture.InitializeAsync();

            await _blobStorageTestsFixture.InitializeAsync();

            var cleanupConfiguration = new DeletedInstanceCleanupConfiguration
            {
                BatchSize       = 10,
                DeleteDelay     = TimeSpan.FromSeconds(1),
                MaxRetries      = 3,
                PollingInterval = TimeSpan.FromSeconds(1),
                RetryBackOff    = TimeSpan.FromSeconds(2),
            };

            var optionsConfiguration = Substitute.For <IOptions <DeletedInstanceCleanupConfiguration> >();

            optionsConfiguration.Value.Returns(cleanupConfiguration);
            DeleteService = new DeleteService(
                _sqlDataStoreTestsFixture.SqlIndexDataStoreFactory,
                _blobStorageTestsFixture.MetadataStore,
                _blobStorageTestsFixture.FileStore,
                optionsConfiguration,
                _sqlDataStoreTestsFixture.SqlTransactionHandler,
                NullLogger <DeleteService> .Instance);
        }
        public async Task InitializeAsync()
        {
            await _sqlDataStoreTestsFixture.InitializeAsync();

            await _blobStorageTestsFixture.InitializeAsync();

            var cleanupConfiguration = new DeletedInstanceCleanupConfiguration
            {
                BatchSize       = 10,
                DeleteDelay     = TimeSpan.FromSeconds(1),
                MaxRetries      = 3,
                PollingInterval = TimeSpan.FromSeconds(1),
                RetryBackOff    = TimeSpan.FromSeconds(2),
            };

            var optionsConfiguration = Substitute.For <IOptions <DeletedInstanceCleanupConfiguration> >();

            optionsConfiguration.Value.Returns(cleanupConfiguration);
            var dicomRequestContextAccessor = Substitute.For <IDicomRequestContextAccessor>();

            dicomRequestContextAccessor.RequestContext.DataPartitionEntry = new PartitionEntry(DefaultPartition.Key, DefaultPartition.Name);

            DeleteService = new DeleteService(
                _sqlDataStoreTestsFixture.IndexDataStore,
                _blobStorageTestsFixture.MetadataStore,
                _blobStorageTestsFixture.FileStore,
                optionsConfiguration,
                _sqlDataStoreTestsFixture.SqlTransactionHandler,
                NullLogger <DeleteService> .Instance,
                dicomRequestContextAccessor);
        }