public async Task setup_once_before_all_tests() { _metricSink = new StubMetricSink(); var timingBlockFactory = new TimingBlockFactory(_metricSink); var timingBlock = timingBlockFactory.Create("foo"); await timingBlock.ExecuteAsync(() => Task.Delay(100)); }
public async Task setup_once_before_all_tests() { _metricSink = new StubMetricSink(); var timingBlockFactory = new TimingBlockFactory(_metricSink); var timingBlock = timingBlockFactory.Create("foo"); await timingBlock.ExecuteAsync(() => { timingBlock.Dimensions.Add("end-only", "some-value"); return(Task.Delay(100)); }); }
public async Task setup_once_before_all_tests() { _metricSink = new StubMetricSink(); var timingBlockFactory = new TimingBlockFactory(_metricSink); var timingBlock = timingBlockFactory.Create("bar"); _result = await timingBlock.ExecuteAsync(async() => { await Task.Delay(100); return(23); }); }
public async Task setup_once_before_all_tests() { _exceptionToThrow = new Exception(); _metricSink = new StubMetricSink(); var timingBlockFactory = new TimingBlockFactory(_metricSink); var timingBlock = timingBlockFactory.Create("bar"); try { await timingBlock.ExecuteAsync(async() => { await Task.Delay(50); throw _exceptionToThrow; }); } catch (Exception e) { _exceptionThrown = e; } }