public async Task TestSyntheticsRunner()
        {
            var testRunner  = new TestRunner();
            var testAlerter = new TestAlerter();

            var provider = new ServiceCollection()
                           .AddSingleton <ISyntheticTest>(testRunner)
                           .AddSingleton <ISyntheticsAlerter>(testAlerter)
                           .BuildServiceProvider();

            var runner = new SyntheticsRunner(provider, new SyntheticsRunnerConfig());

            await runner.RunSyntheticTests(CancellationToken.None);

            Assert.True(testRunner.DidRun);
            Assert.False(testAlerter.DidAlert);
        }
        public async Task TestSyntheticsRunnerCancellationToken()
        {
            var testAlerter = new TestAlerter();

            var provider = new ServiceCollection()
                           .AddSingleton <ISyntheticTest>(new TestCancellableAsynchronousRunner())
                           .AddSingleton <ISyntheticTest>(new TestHangingSynchronousRunner())
                           .AddSingleton <ISyntheticsAlerter>(testAlerter)
                           .BuildServiceProvider();

            var runner = new SyntheticsRunner(provider, new SyntheticsRunnerConfig());

            var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromMilliseconds(500));

            await runner.RunSyntheticTests(cancellationTokenSource.Token);

            Assert.True(testAlerter.DidAlert);
        }
        public async Task TestSyntheticsRunnerCancelAsynchronousRunner()
        {
            var testAlerter = new TestAlerter();

            var provider = new ServiceCollection()
                           .AddSingleton <ISyntheticTest>(new TestCancellableAsynchronousRunner())
                           .AddSingleton <ISyntheticsAlerter>(testAlerter)
                           .BuildServiceProvider();

            var runner = new SyntheticsRunner(provider, new SyntheticsRunnerConfig
            {
                SyntheticTestTimeout = TimeSpan.FromMilliseconds(500)
            });

            await runner.RunSyntheticTests(CancellationToken.None);

            Assert.True(testAlerter.DidAlert);
        }