示例#1
0
        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));
        }
示例#2
0
        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);
            });
        }
示例#4
0
        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;
            }
        }