public async Task Test(bool canWrite, int expectedCount) { var options = new AuditTrailClientOptions { ResendIntervalInSeconds = 0 }; var items = new[] { new AuditTrailItem(), new AuditTrailItem(), new AuditTrailItem() }; TestSink sink = new TestSink(canWrite); TestTokenStore store = new TestTokenStore(items); var service = new AuditTrailRecoveryService(Options.Create(options), new TestLogger <AuditTrailRecoveryService>(), store, sink); await service.StartAsync(default);
private static AuditTrailClient CreateClient(HttpMessageHandler handler, HttpMessageHandler?tokenHandler = null, bool tokenSinkResult = true, IAuditTrailStore?store = null, IHostEnvironment?env = null) { var options = new AuditTrailClientOptions { DeliveryEndpoint = "https://uruk.example.com/events" }; HttpClient httpClient = new HttpClient(handler); return(new AuditTrailClient( httpClient, Options.Create(options), new TestTokenSink(tokenSinkResult), store ?? new TestTokenStore(), new TestLogger <AuditTrailClient>(), new NullAccessTokenAcquisitor(), env)); }