public async Task same_index_understood_as_no_change() { var config = new SimpleProperties(); var updater = Structure.Start(config, TestOptions(next => env => env.Response(200, 0))); await HttpSuccesses.Dequeue(); HttpErrors.Count.ShouldBe(0); KeyValuesAssigned.Count.ShouldBe(0); await updater.Stop(); }
public async Task retries_on_errors_until_successful() { int retries = 0; var listener = Structure.Start( new SimpleProperties(), TestOptions(next => env => (retries++ < 1 ? env.Response(500) : next(env)))); ConsulKvSimulator.PutKey("keystring", "first"); var success = await HttpSuccesses.Dequeue(); success.Item2.StatusCode.ShouldBe((HttpStatusCode)200); await listener.Stop(); }
public async Task http_events_published() { var config = new SimpleProperties(); var updater = Structure.Start(config, TestOptions()); ConsulKvSimulator.PutKey("keystring", "http"); var result = await HttpSuccesses.Dequeue(); result.Item1.RequestUri.AbsolutePath.ShouldStartWith("/v1/kv/"); result.Item2.StatusCode.ShouldBe(HttpStatusCode.OK); result.Item3.ShouldBeGreaterThan(TimeSpan.Zero); await updater.Stop(); }