public void Dispose_ClosesStorageEmulatorIfStartedByAutomation() { new AzureStorageEmulatorAutomation().Stop(); _sut.Start(); _sut.Dispose(); TestHelper.VerifyAzureStorageEmulatorIsNotRunning(); }
public AzureStorageEmulatorFixture() { _automation = new AzureStorageEmulatorAutomation(); Console.WriteLine("----- Invoking Automation Start -----"); _automation.Start(); }
public async Task <SmokeResponse> RunSmokeTest(string queueName, Func <Message, Task> action, string topicName = null, bool useSession = false) { ServiceProvider serviceProvider = Services.BuildServiceProvider(); if (IsDevelopment && !_useMocking) { using (AzureStorageEmulatorAutomation azureStorageEmulatorAutomation = new AzureStorageEmulatorAutomation()) { await azureStorageEmulatorAutomation.Init(); await azureStorageEmulatorAutomation.Start(); return(await RunSmokeTest(serviceProvider.GetRequiredService <IMessengerService>(), queueName, action, topicName, useSession)); } } else { return(await RunSmokeTest(serviceProvider.GetRequiredService <IMessengerService>(), queueName, action, topicName, useSession)); } }
/// <summary> /// Setup /// </summary> public BlobStorageServiceTest() { _emulator = new AzureStorageEmulatorAutomation(); _emulator.Start(); if (!AzureStorageEmulatorAutomation.IsEmulatorRunning()) { throw new Exception("Azure Storage Emulatorの起動に失敗しました"); } // 設定ファイルの読み込み var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .Build(); // サービスの構成 var serviceCollection = new ServiceCollection(); serviceCollection.AddSingleton <IBlobStorageService>(factory => new BlobStorageService(configuration["ConnectionStrings:StorageConnection"])); _service = serviceCollection.BuildServiceProvider().GetService <IBlobStorageService>(); // ファイル生成 Directory.CreateDirectory(_testDataPath); foreach (var fileName in _testFiles) { File.WriteAllText(Path.Combine(_testDataPath, fileName), "This is test."); } }
private void StartLocalRuntime() { _emulator = new AzureStorageEmulatorAutomation(); if (!AzureStorageEmulatorAutomation.IsEmulatorRunning()) { _emulator.Start(); } }
public AzureStorageEmulatorFixture() { emulatorAutomation = new AzureStorageEmulatorAutomation(); emulatorAutomation.Start(); }
public AzureStorageEmulatorFixture() { _automation = new AzureStorageEmulatorAutomation(); _automation.Start(); }