public async Task setup_scenario() { var baseHttpClient = new StubHttpClient(new Exception()); var configuration = new InstrumentingConfiguration { Uri = new Uri("http://localhost") }; var httpClient = baseHttpClient.AddInstrumenting(configuration, new[] { _callback }); try { await httpClient.GetAsync("/ping"); } catch { // Ignore the exception } }
public async Task setup_scenario() { _exceptionThrown = new Exception(); var baseHttpClient = new StubHttpClient(_exceptionThrown); var configuration = new InstrumentingConfiguration { Uri = new Uri("http://exception-host") }; var httpClient = baseHttpClient.AddInstrumenting(configuration, new [] { _callback }); try { await httpClient.GetAsync("/ping"); } catch (Exception e) { _exception = e; } }