public Fixture(WebApplicationFactory <Startup> factory) { _factory = factory; StorageClientFactory.Create().Returns(Task.FromResult(StorageClient)); _defaultMocks = c => { c.AddSingleton(StorageClientFactory); c.AddSingleton(BatchFinalizer); }; }
/// <summary> /// Saves tracking data to a file or in the azure storage container /// </summary> public async Task Flush() { var storageClient = StorageClientFactory.Create(ControllerConfiguration.StorageClientType); await storageClient.WriteText( JsonConvert.SerializeObject(new { configuration = new SimpleBenchmarkConfiguration { TestCaseType = TestCaseConfiguration.TestCaseType, TransportType = TestCaseConfiguration.TransportType, MessageCount = BenchmarkConfiguration.MessageCount, FillerSize = BenchmarkConfiguration.FillerSize, ClientCount = BenchmarkConfiguration.ClientCount, Timeout = BenchmarkConfiguration.Timeout, AzureServiceBusOperationTimeout = TransportConfiguration.AzureServiceBusOperationTimeout, UseExpress = TransportConfiguration.UseExpress, }, events = _events, }), $"{BenchmarkConfiguration.Name}.json" ); }
public void Should_CreateFileStorageClient_When_StorageClientType_File() { var storageClient = StorageClientFactory.Create(StorageClientType.File); Assert.IsType <FileStorageClient>(storageClient); }